Control of RMS with PID
조회 수: 7 (최근 30일)
이전 댓글 표시
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
Mathieu NOE
2025년 6월 16일
편집: Mathieu NOE
2025년 6월 16일
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) ?
채택된 답변
Meet
2025년 6월 20일
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!!
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Classical Control Design에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!