Documentation |
Package: TuningGoal
Maximum loop gain constraint for control system tuning
Use the TuningGoal.MaxLoopGain object to enforce a maximum loop gain and desired roll-off in a particular frequency band. Use this requirement with control system tuning commands such as systune or looptune.
This requirement imposes a maximum gain on the open-loop frequency response (L) at a specified location in your control system. You specify the maximum open-loop gain as a function of frequency (a maximum gain profile). For MIMO feedback loops, the specified gain profile is interpreted as an upper bound on the largest singular value of L.
When you tune a control system, the maximum gain profile is converted to a maximum gain constraint on the complementary sensitivity function, T) = L/(I + L).
The following figure shows a typical specified maximum gain profile (dashed line) and a resulting tuned loop gain, L (blue line). The pink region represents gain profile values that are forbidden by this requirement. The figure shows that when L is much smaller than 1, imposing a maximum gain on T is a good proxy for a maximum open-loop gain.
TuningGoal.MaxLoopGain and TuningGoal.MinLoopGain specify only high-gain or low-gain constraints in certain frequency bands. When you use these requirements, systune and looptune determine the best loop shape near crossover. When the loop shape near crossover is simple or well understood (such as integral action), you can use TuningGoal.LoopShape to specify that target loop shape.
Req = TuningGoal.MaxLoopGain(location,loopgain) creates a tuning requirement for limiting the gain of a SISO or MIMO feedback loop. The requirement limits the open-loop frequency response measured at the specified locations to the maximum gain profile specified by loopgain. You can specify the maximum gain profile as a smooth transfer function or sketch a piecewise error profile using an frd model or the makeweight command. Only gain values smaller than 1 are enforced.
Req = TuningGoal.MaxLoopGain(location,fmax,gmax) specifies a maximum gain profile of the form loopgain = K/s (integral action). The software chooses K such that the gain value is gmax at the specified frequency, fmax.
location |
Location at which the maximum open-loop gain is constrained, specified as a string or cell array of strings. These strings identify one or more loop-opening locations in the control system to tune. What loop-opening locations are available depends on what kind of system you are tuning:
If location is a cell array of loop-opening locations, then the maximum gain requirement applies to the resulting MIMO loop. |
loopgain |
Maximum open-loop gain as a function of frequency. You can specify loopgain as a smooth SISO transfer function (tf, zpk, or ss model). Alternatively, you can sketch a piecewise gain profile using a frd model or the makeweight command. For example, the following frd model specifies a maximum gain of 1 (0 dB) at 1 rad/s, rolling off at a rate of –20 dB/dec up to 10 rad/s, and a rate of –40 dB/dec at higher frequencies. loopgain = frd([1 1e-1 1e-3],[1 10 100]); bodemag(loopgain)
When you use an frd model to specify loopgain, the software automatically maps your specified gain profile to a zpk model. The magnitude of this model approximates the desired gain profile. Use viewSpec(Req) to plot the magnitude of that zpk model. Only gain values smaller than 1 are enforced. For multi-input, multi-output (MIMO) feedback loops, the gain profile is interpreted as a minimum roll-off requirement, which is an upper bound on the largest singular value of L. For more information about singular values, see sigma. |
fmax |
Frequency of maximum gain gmax, specified as a scalar value in rad/s. Use this argument to specify a maximum gain profile of the form loopgain = K/s (integral action). The software chooses K such that the gain value is gmax at the specified frequency, fmax. |
gmax |
Value of maximum gain occurring at fmax, specified as a scalar absolute value. Use this argument to specify a maximum gain profile of the form loopgain = K/s (integral action). The software chooses K such that the gain value is gmax at the specified frequency, fmax. |
MaxGain |
Maximum open-loop gain as a function of frequency, specified as a SISO zpk model. The software automatically maps the input argument loopgain onto a zpk model. The magnitude of this zpk model approximates the desired gain profile. Alternatively, if you use the fmax and gmax arguments to specify the gain profile, this property is set to K/s. The software chooses K such that the gain value is gmax at the specified frequency, fmax. Use viewSpec(Req) to plot the magnitude of the open-loop maximum gain profile. |
Focus |
Frequency band in which tuning requirement is enforced, specified as a row vector of the form [min,max]. Set the Focus property to limit enforcement of the requirement to a particular frequency band. Express this value in the frequency units of the control system model you are tuning (rad/TimeUnit). For example, suppose Req is a requirement that you want to apply only between 1 and 100 rad/s. To restrict the requirement to this band, use the following command: Req.Focus = [1,100]; Default: [0,Inf] for continuous time; [0,pi/Ts] for discrete time, where Ts is the model sampling time. |
Stabilize |
Stability requirement on closed-loop dynamics, specified as 1 (true) or 0 (false). When Stabilize is true, this requirement stabilizes the specified feedback loop, as well as imposing gain or loop-shape requirements. Set Stabilize to false if stability for the specified loop is not required or cannot be achieved. Default: 1 (true) |
LoopScaling |
Toggle for automatically scaling loop signals, specified as 'on' or 'off'. In multi-loop or MIMO control systems, the feedback channels are automatically rescaled to equalize the off-diagonal terms in the open-loop transfer function (loop interaction terms). Set LoopScaling to 'off' to disable such scaling and shape the unscaled open-loop response. Default: 'on' |
Location |
Location at which maximum loop gain is constrained, specified as a string or cell array of strings. These strings identify one or more loop-opening locations in the control system to tune. The value of the Location property is set by the location input argument when you create the TuningGoal.Sensitivity requirement. |
Models |
Models to which the tuning requirement applies, specified as a vector of indices. Use the Models property when tuning an array of control system models with systune, to enforce a tuning requirement for a subset of models in the array. For example, suppose you want to apply the tuning requirement, Req, to the second, third, and fourth models in a model array passed to systune. To restrict enforcement of the requirement, use the following command: Req.Models = 2:4; When Models = NaN, the tuning requirement applies to all models. Default: NaN |
Openings |
Feedback loops to open when evaluating the requirement, specified as a cell array of strings that identify loop-opening locations. The tuning requirement is evaluated against the open-loop configuration created by opening feedback loops at the locations you identify. If you are using the requirement to tune a Simulink model of a control system, then Openings can include any linear analysis point marked in the model, or any linear analysis point in an slTuner interface associated with the Simulink model. Use addPoint to add analysis points and loop openings to the slTuner interface. Use getPoints to get the list of analysis points available in an slTuner interface to your model. If you are using the requirement to tune a generalized state-space (genss) model of a control system, then Openings can include any AnalysisPoint location in the control system model. Use getPoints to get the list of analysis points available in the genss model. Default: {} |
Name |
Name of the requirement object, specified as a string. For example, if Req is a requirement: Req.Name = 'LoopReq'; Default: [] |
When you tune a control system using a TuningGoal object to specify a tuning requirement, the software converts the requirement into a normalized scalar value f(x). Here, x is the vector of free (tunable) parameters in the control system. The software then adjusts the parameter values to minimize f(x) or to drive f(x) below 1 if the tuning requirement is a hard constraint.
For the TuningGoal.MaxLoopGain requirement, f(x) is given by:
$$f\left(x\right)={\Vert {W}_{T}\left({D}^{-1}TD\right)\Vert}_{\infty}.$$
W_{T} is the reciprocal of the maximum loop gain profile, MaxGain. D is a diagonal scaling (for MIMO loops). T is the complementary sensitivity function at Location.
Although T is a closed-loop transfer function, driving f(x) < 1 is equivalent to enforcing an upper bound on the open-loop transfer, L, in a frequency band where the gain of L is less than one. To see why, note that T = L/(I + L). For SISO loops, when |L| << 1, |T| ≈ |L|. Therefore, enforcing the open-loop maximum gain requirement, |L| < 1/|W_{T}|, is roughly equivalent to enforcing |W_{T}T| < 1. For MIMO loops, similar reasoning applies, with ||T|| ≈ σ_{max}(L), where σ_{max} is the largest singular value.
Create a requirement that limits the maximum open-loop gain of a feedback loop to a specified profile.
Suppose that you are tuning a control system that has a loop-opening location identified by PILoop. Limit the open-loop gain measured at that location to 1 (0 dB) at 1 rad/s, rolling off at a rate of -20 dB/dec up to 10 rad/s, and a rate of -40 dB/dec at higher frequencies. Use an frd model to sketch this gain profile.
loopgain = frd([1 1e-1 1e-3],[1 10 100]);
Req = TuningGoal.MaxLoopGain('PILoop',loopgain);
The software converts loopgain into a smooth function of frequency that approximates the piecewise-specified requirement. Display the requirement using viewSpec.
viewSpec(Req)
The yellow region indicates where the requirement is violated, except that gain values greater than 1 are not enforced. Therefore, this requirement only specifies minimum roll-off rates at frequencies above 1 rad/s.
You can use Req as an input to looptune or systune when tuning the control system.
Create a requirement that specifies a maximum loop gain of the form L = K / s . The maximum gain attains the value of -20 dB (0.01) at 100 rad/s.
Req = TuningGoal.MaxLoopGain('X',100,0.01);
viewSpec(Req)
viewSpec confirms that the requirement is correctly specified. You can use this requirement to tune a control system that has a loop-opening location identified as 'X'. Since loop gain values greater than 1 are ignored, this requirement specifies a rolloff of 20 dB/decade above 1 rad/s, with no restriction on loop gain below that frequency.
Create a requirement that specifies a maximum loop gain of –20 dB (0.01) at 100 rad/s on the inner loop of the following control system.
Req = TuningGoal.MaxLoopGain('X2',100,0.01);
Configure the requirement to apply to the loop gain of the inner loop measured with the outer loop open.
Req.Openings = 'X2';
Setting Req.Openings tells the tuning algorithm to enforce this requirement with loops open at the specified location.
By default, tuning using TuningGoal.MaxLoopGain imposes a stability requirement as well as the maximum loop gain requirement. Practically, in some control systems it is not possible to achieve a stable inner loop. When this occurs, remove the stability requirement for the inner loop by setting the Stabilize property to false.
Req.Stabilize = false;
The tuning algorithm still imposes a stability requirement on the overall tuned control system, but not on the inner loop alone.
evalSpec | looptune | looptune (for slTuner) | sigma | slTuner | systune | systune (for slTuner) | TuningGoal.Gain | TuningGoal.LoopShape | TuningGoal.Margins | TuningGoal.MinLoopGain | viewSpec