Set options for looptune
options = looptuneOptions
options = looptuneOptions(Name,Value)
Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
looptuneOptions takes the following Name arguments:
Target gain margin in decibels. GainMargin specifies the required gain margin for the tuned control system. For MIMO control systems, the gain margin is the multiloop disk margin. See loopmargin for the definition of the multiloop disk margin.
Default: 7.6 dB
Target phase margin in degrees. PhaseMargin specifies the required phase margin for the tuned control system. For MIMO control systems, the phase margin is the multiloop disk margin. See loopmargin for the definition of the multiloop disk margin.
Default: 45 degrees
String determining the amount of information to display during looptune runs.
Display takes the following values:
Maximum number of iterations in each optimization run.
Number of additional optimizations starting from random values of the free parameters in the controller.
If RandomStart = 0, looptune performs a single optimization run starting from the initial values of the tunable parameters. Setting RandomStart = N > 0 runs N additional optimizations starting from N randomly generated parameter values.
looptune tunes by finding a local minimum of a gain minimization problem. To increase the likelihood of finding parameter values that meet your design requirements, set RandomStart > 0. You can then use the best design that results from the multiple optimization runs.
Use with UseParallel = true to distribute independent optimization runs among MATLAB® workers (requires Parallel Computing Toolbox™ software).
Parallel processing flag.
Set to true to enable parallel processing by distributing randomized starts among workers in a parallel pool. If there is an available parallel pool, then the software performs independent optimization runs concurrently among workers in that pool. If no parallel pool is available, one of the following occurs:
If Automatically create a parallel pool is not selected in your preferences, you can manually start a parallel pool using parpool before running the tuning command.
Using parallel processing requires Parallel Computing Toolbox software.
Target value for the objective parameter gam.
The looptune command converts your design requirements into normalized gain constraints. The command then tunes the free parameters of the control system to drive the objective parameter gam below 1 to enforce all requirements.
The default TargetGain = 1 ensures that the optimization stops as soon as gam falls below 1. Set TargetGain to a smaller or larger value to continue the optimization or start sooner, respectively.
Relative tolerance for termination.
The optimization terminates when the objective parameter gam decreases by less than TolGain over 10 consecutive iterations. Increasing TolGain speeds up termination, and decreasing TolGain yields tighter final values.
Maximum closed-loop natural frequency.
Setting MaxFrequency constrains the closed-loop poles to satisfy |p| < MaxFrequency.
To allow looptune to choose the closed-loop poles automatically, based upon the system's open-loop dynamics, set MaxFrequency = Inf. To prevent unwanted fast dynamics or high-gain control, set MaxFrequency to a finite value.
Specify MaxFrequency in units of 1/TimeUnit, relative to the TimeUnit property of the system you are tuning.
Minimum decay rate for closed-loop poles
Constrains the closed-loop poles to satisfy Re(p) < -MinDecay. Increase this value to improve the stability of closed-loop poles that do not affect the closed-loop gain due to pole/zero cancellations.
Specify MinDecay in units of 1/TimeUnit, relative to the TimeUnit property of the system you are tuning.
Create an options set for a looptune run using three random restarts. Also, set the target gain and phase margins to 6 dB and 50 degrees, respectively, and limit the closed-loop pole magnitude to 100.
options = looptuneOptions('RandomStart',3','GainMargin',6,... 'PhaseMargin',50,'SpecRadius',100);
Alternatively, use dot notation to set the values of options.
options = looptuneOptions; options.RandomStart = 3; options.GainMargin = 6; options.PhaseMargin = 50; options.SpecRadius = 100;
Configure an option set for a looptune run using 20 random restarts. Execute these independent optimization runs concurrently on multiple workers in a parallel pool.
If you have the Parallel Computing Toolbox software installed, you can use parallel computing to speed up looptune tuning of fixed-structure control systems. When you run multiple randomized looptune optimization starts, parallel computing speeds up tuning by distributing the optimization runs among workers.
If Automatically create a parallel pool is selected in your preferences, you do not need to manually start a pool.
Create a looptuneOptions set that specifies 20 random restarts to run in parallel.
options = looptuneOptions('RandomStart',20,'UseParallel',true);
Setting UseParallel to true enables parallel processing by distributing the randomized starts among available workers in the parallel pool.
Use the looptuneOptions set when you call looptune. For example, suppose you have already created a plant model G0 and tunable controller C0. In this case, the following command uses parallel computing to tune the control system of G0 and C0 to the target crossoverwc.
[G,C,gamma] = looptune(G0,C0,wc,options);