Control of RMS with PID

7 vues (au cours des 30 derniers jours)
Volcano
Volcano le 16 Juin 2025
Commenté : Volcano le 21 Juin 2025
Hi. I prepared the following structure to keep the RMS value of my signal constant at 1.02. However, this diagram gives the error given below:
Compilation of model 'sim_model' failed while trying to resolve underspecified signal dimensions.
Caused by:
Unable to determine signal dimensions. There is a loop consisting of 'sim_model/PID/Sum/Sum_PID/Sum' that cannot be resolved because signal dimensions are defined by a cyclic relationship. Specifying the signal dimensions on Inport, Mux, Selector, Demuxes will help resolve signal dimensions in the loop. You can also use the Signal Specifications to define the signal dimensions.
When i use two RMS blocks, the following diagram can work:
Where is my mistake here? Or, is my idea completely wrong?
Thank you,
Note: I have not yet worked on PID tuning.
  2 commentaires
Mathieu NOE
Mathieu NOE le 16 Juin 2025
Modifié(e) : Mathieu NOE le 16 Juin 2025
hello
the first diagram contain a loop , and as it happens quite often this creates issue if you don't use one of these solutions to avoid algebraic loops
the second idgram has no loop => no issue
I understand your idea of keeping the rms constant but NB that a "Moving RMS" will add some delay in your "process" so be gentle on the PID gains . Anyway , I suppose that the idea is not to maintain rms on every samples but more like a genral trend (with some fluctuation) ?
Volcano
Volcano le 21 Juin 2025
Thank you for your response. I fixed the problem with a delay block.

Connectez-vous pour commenter.

Réponse acceptée

Meet
Meet le 20 Juin 2025
Hi,
The error you are facing is related to an algebraic loop in your Simulink model, where the signal dimensions cannot be resolved because of a cyclic dependency in the feedback path. This is a common issue when using feedback loops with blocks like RMS and PID controllers.
I would suggest you to try the below steps:
  • Use the "Signal Specification block" after the RMS or PID blocks to explicitly define the signal dimensions. This helps Simulink resolve the size of signals in the loop.
  • Introduce a "Unit Delay" block in the feedback path. This breaks the direct cyclic dependency and allows Simulink to compute signal dimensions sequentially.
  • Make sure all blocks in the loop expect and output signals with consistent dimensions. Mismatched dimensions can cause dimension resolution failures.
In addition to the steps mentioned above, I also recommend that you review this MathWorks documentation on how to remove algebraic loops in a model, as Mathieu suggested: https://www.mathworks.com/help/simulink/ug/remove-algebraic-loops.html
I hope this helps resolve the issue!!
  1 commentaire
Volcano
Volcano le 21 Juin 2025
Thank you. As you mentioned, i used a delay block to solve my problem.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by