Documentation Center

  • Trial Software
  • Product Updates

Contents

looptuneOptions

Set options for looptune

Syntax

options = looptuneOptions
options = looptuneOptions(Name,Value)

Description

options = looptuneOptions returns the default option set for the looptune command.

options = looptuneOptions(Name,Value) creates an option set with the options specified by one or more Name,Value pair arguments.

Input Arguments

Name-Value Pair Arguments

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:

'GainMargin'

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

'PhaseMargin'

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

'Display'

String determining the amount of information to display during looptune runs.

Display takes the following values:

  • 'off' — Run in silent mode, displaying no information during or after the run.

  • 'iter' — Display optimization progress after each iteration. The display includes the value of the objective parameter gam after each iteration. The display also includes a Progress value, indicating the percent change in gam from the previous iteration.

  • 'final' — Display a one-line summary at the end of each optimization run. The display includes the minimized value of gam and the number of iterations for each run.

Default: 'final'

'MaxIter'

Maximum number of iterations in each optimization run.

Default: 300

'RandomStart'

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).

Default: 0

'UseParallel'

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 selected in your Parallel Computing Toolbox preferences, then the software starts a parallel pool using the settings in those preferences.

  • If Automatically create a parallel pool is not selected in your preferences, then the software performs the optimization runs successively, without parallel processing.

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.

Default: false

'TargetGain'

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.

Default: 1

'TolGain'

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.

Default: 0.001

'MaxFrequency'

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.

Default: Inf

'MinDecay'

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.

Default: 1e-7

Output Arguments

options

Option set containing the specified options for the looptune command.

Examples

expand all

Create Options Set for looptune

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 Option Set for Parallel Optimization Runs

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 not selected in your Parallel Computing Toolbox preferences, manually start a parallel pool using parpool. For example:

parpool;

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);

See Also

| |

Was this topic helpful?