|
3 | 3 | P = tf(1, [1, 0.2, 1])
|
4 | 4 | C = pid(0.2, 1)
|
5 | 5 | loopgain = P*C
|
6 |
| -marginplot(loopgain)</code></pre><img src="bc5226f0.svg" alt="Example block output"/><p>This plot tells us that there is one gain margin of 1.27, i.e., the gain can increase by a factor of 1.27 before the system goes unstable. It also tells us that there are three different phase margins, the smallest of which is about 9°. We usually aim for a gain margin of >1.5 and a phase margin above 30-45° for a robust system. The vertical lines in the plot indicate the frequencies at which the margins have been computed.</p><h2 id="Sensitivity-analysis"><a class="docs-heading-anchor" href="#Sensitivity-analysis">Sensitivity analysis</a><a id="Sensitivity-analysis-1"></a><a class="docs-heading-anchor-permalink" href="#Sensitivity-analysis" title="Permalink"></a></h2><p>More generally applicable measures of robustness include analysis of sensitivity functions, notably the peaks of the sensitivity function</p><p class="math-container">\[S(s) = (I + P(s)C(s))^{-1}\]</p><p>and the complementary sensitivity function</p><p class="math-container">\[T(s) = I - S(s) = (I + P(s)C(s))^{-1}P(s)C(s)\]</p><h3 id="Examples"><a class="docs-heading-anchor" href="#Examples">Examples</a><a id="Examples-1"></a><a class="docs-heading-anchor-permalink" href="#Examples" title="Permalink"></a></h3><p>We can plot all four sensitivity functions referred to as the "gang of four" using <a href="../../lib/plotting/#ControlSystemsBase.gangoffourplot-Tuple{Union{LTISystem, Vector}, Vector, Vararg{Any}}"><code>gangoffourplot</code></a>.</p><pre><code class="language-julia hljs">using ControlSystemsBase, Plots |
| 6 | +marginplot(loopgain)</code></pre><img src="5e8be9e3.svg" alt="Example block output"/><p>This plot tells us that there is one gain margin of 1.27, i.e., the gain can increase by a factor of 1.27 before the system goes unstable. It also tells us that there are three different phase margins, the smallest of which is about 9°. We usually aim for a gain margin of >1.5 and a phase margin above 30-45° for a robust system. The vertical lines in the plot indicate the frequencies at which the margins have been computed.</p><h2 id="Sensitivity-analysis"><a class="docs-heading-anchor" href="#Sensitivity-analysis">Sensitivity analysis</a><a id="Sensitivity-analysis-1"></a><a class="docs-heading-anchor-permalink" href="#Sensitivity-analysis" title="Permalink"></a></h2><p>More generally applicable measures of robustness include analysis of sensitivity functions, notably the peaks of the sensitivity function</p><p class="math-container">\[S(s) = (I + P(s)C(s))^{-1}\]</p><p>and the complementary sensitivity function</p><p class="math-container">\[T(s) = I - S(s) = (I + P(s)C(s))^{-1}P(s)C(s)\]</p><h3 id="Examples"><a class="docs-heading-anchor" href="#Examples">Examples</a><a id="Examples-1"></a><a class="docs-heading-anchor-permalink" href="#Examples" title="Permalink"></a></h3><p>We can plot all four sensitivity functions referred to as the "gang of four" using <a href="../../lib/plotting/#ControlSystemsBase.gangoffourplot-Tuple{Union{LTISystem, Vector}, Vector, Vararg{Any}}"><code>gangoffourplot</code></a>.</p><pre><code class="language-julia hljs">using ControlSystemsBase, Plots |
7 | 7 | P = tf(1, [1, 0.2, 1])
|
8 | 8 | C = pid(0.2, 1)
|
9 |
| -gangoffourplot(P, C)</code></pre><img src="5e12ae89.svg" alt="Example block output"/><p>The peak value of the sensitivity function, <span>$M_S$</span>, can be computed using <a href="../../lib/analysis/#ControlSystemsBase.hinfnorm-Tuple{AbstractStateSpace{<:Continuous}}"><code>hinfnorm</code></a></p><pre><code class="language-julia hljs">S = sensitivity(P, C) |
| 9 | +gangoffourplot(P, C)</code></pre><img src="f6cfa62c.svg" alt="Example block output"/><p>The peak value of the sensitivity function, <span>$M_S$</span>, can be computed using <a href="../../lib/analysis/#ControlSystemsBase.hinfnorm-Tuple{AbstractStateSpace{<:Continuous}}"><code>hinfnorm</code></a></p><pre><code class="language-julia hljs">S = sensitivity(P, C) |
10 | 10 | Ms, ωMs = hinfnorm(S)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(8.14779356151499, 1.0941856436200372)</code></pre><p>And we can plot a circle in the Nyquist plot corresponding to the inverse distance between the loop-transfer function and the critical point:</p><pre><code class="language-julia hljs">w = exp10.(-1:0.001:2)
|
11 |
| -nyquistplot(P*C, w, Ms_circles=[Ms], xlims=(-1.2, 0.5), ylims=(-2, 0.3))</code></pre><img src="6e8b1dfd.svg" alt="Example block output"/><p><span>$M_S$</span> is always <span>$≥ 1$</span>, but we typically want to keep it below 1.3-2 for robustness reasons. For SISO systems, <span>$M_S$</span> is linked to the classical gain and phase margins through the following inequalities:</p><p class="math-container">\[\begin{aligned} |
| 11 | +nyquistplot(P*C, w, Ms_circles=[Ms], xlims=(-1.2, 0.5), ylims=(-2, 0.3))</code></pre><img src="3d3b579b.svg" alt="Example block output"/><p><span>$M_S$</span> is always <span>$≥ 1$</span>, but we typically want to keep it below 1.3-2 for robustness reasons. For SISO systems, <span>$M_S$</span> is linked to the classical gain and phase margins through the following inequalities:</p><p class="math-container">\[\begin{aligned} |
12 | 12 | \phi_m &≥ 2 \sin^{-1}\left(\dfrac{1}{2M_S}\right) \text{rad}\\
|
13 | 13 | g_m &≥ \dfrac{M_S}{M_S-1}
|
14 |
| -\end{aligned}\]</p><p>We can also obtain individual sensitivity function using the low-level function <a href="../../lib/constructors/#ControlSystemsBase.feedback"><code>feedback</code></a> directly, or using one of the higher-level functions</p><ul><li><a href="../../lib/synthesis/#ControlSystemsBase.sensitivity-Tuple"><code>sensitivity</code></a></li><li><a href="../../lib/synthesis/#ControlSystemsBase.comp_sensitivity-Tuple"><code>comp_sensitivity</code></a></li><li><a href="../../lib/synthesis/#ControlSystemsBase.G_PS-Tuple{Any, Any}"><code>G_PS</code></a></li><li><a href="../../lib/synthesis/#ControlSystemsBase.G_CS-Tuple{Any, Any}"><code>G_CS</code></a></li><li><a href="../../lib/analysis/#ControlSystemsBase.gangoffour-Tuple{LTISystem, LTISystem}"><code>gangoffour</code></a></li><li><a href="../../lib/synthesis/#ControlSystemsBase.extended_gangoffour"><code>extended_gangoffour</code></a></li><li><code>RobustAndOptimalControl.feedback_control</code></li></ul><h2 id="Further-reading"><a class="docs-heading-anchor" href="#Further-reading">Further reading</a><a id="Further-reading-1"></a><a class="docs-heading-anchor-permalink" href="#Further-reading" title="Permalink"></a></h2><p>A modern robustness measure is the <a href="https://juliacontrol.github.io/RobustAndOptimalControl.jl/dev/#Diskmargin-example"><code>diskmargin</code></a>, that analyses the robustness of a SISO or MIMO system to simultaneous gain and phase variations.</p><p>In the presence of structured uncertainty, such as parameter uncertainty or other explicitly modeled uncertainty, the structured singular value (often referred to as <span>$\mu$</span>), provides a way to analyze robustness with respect to the modeled uncertainty. See the <a href="https://juliacontrol.github.io/RobustAndOptimalControl.jl/dev/">RobustAndOptimalControl.jl</a> package for more details.</p><p>Basic usage of robustness analysis with JuliaControl are demonstrated in the two videos below:</p><iframe style="height: 315px; width: 560px" src="https://www.youtube.com/embed/zTW4mlWNumo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><p>and </p><iframe style="height: 315px; width: 560px" src="https://www.youtube.com/embed/gIsa93GvPbg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../example/">« Design</a><a class="docs-footer-nextpage" href="../smith_predictor/">Smith predictor »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.1 on <span class="colophon-date" title="Thursday 13 February 2025 09:45">Thursday 13 February 2025</span>. Using Julia version 1.11.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
| 14 | +\end{aligned}\]</p><p>We can also obtain individual sensitivity function using the low-level function <a href="../../lib/constructors/#ControlSystemsBase.feedback"><code>feedback</code></a> directly, or using one of the higher-level functions</p><ul><li><a href="../../lib/synthesis/#ControlSystemsBase.sensitivity-Tuple"><code>sensitivity</code></a></li><li><a href="../../lib/synthesis/#ControlSystemsBase.comp_sensitivity-Tuple"><code>comp_sensitivity</code></a></li><li><a href="../../lib/synthesis/#ControlSystemsBase.G_PS-Tuple{Any, Any}"><code>G_PS</code></a></li><li><a href="../../lib/synthesis/#ControlSystemsBase.G_CS-Tuple{Any, Any}"><code>G_CS</code></a></li><li><a href="../../lib/analysis/#ControlSystemsBase.gangoffour-Tuple{LTISystem, LTISystem}"><code>gangoffour</code></a></li><li><a href="../../lib/synthesis/#ControlSystemsBase.extended_gangoffour"><code>extended_gangoffour</code></a></li><li><code>RobustAndOptimalControl.feedback_control</code></li></ul><h2 id="Further-reading"><a class="docs-heading-anchor" href="#Further-reading">Further reading</a><a id="Further-reading-1"></a><a class="docs-heading-anchor-permalink" href="#Further-reading" title="Permalink"></a></h2><p>A modern robustness measure is the <a href="https://juliacontrol.github.io/RobustAndOptimalControl.jl/dev/#Diskmargin-example"><code>diskmargin</code></a>, that analyses the robustness of a SISO or MIMO system to simultaneous gain and phase variations.</p><p>In the presence of structured uncertainty, such as parameter uncertainty or other explicitly modeled uncertainty, the structured singular value (often referred to as <span>$\mu$</span>), provides a way to analyze robustness with respect to the modeled uncertainty. See the <a href="https://juliacontrol.github.io/RobustAndOptimalControl.jl/dev/">RobustAndOptimalControl.jl</a> package for more details.</p><p>Basic usage of robustness analysis with JuliaControl are demonstrated in the two videos below:</p><iframe style="height: 315px; width: 560px" src="https://www.youtube.com/embed/zTW4mlWNumo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><p>and </p><iframe style="height: 315px; width: 560px" src="https://www.youtube.com/embed/gIsa93GvPbg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../example/">« Design</a><a class="docs-footer-nextpage" href="../smith_predictor/">Smith predictor »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.1 on <span class="colophon-date" title="Thursday 13 February 2025 13:31">Thursday 13 February 2025</span>. Using Julia version 1.11.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
0 commit comments