Main Content

systune

Tune control system parameters in金宝appusingslTunerinterface

Description

systunetunes fixed-structure control systems subject to both soft and hard design goals.systunecan tune multiple fixed-order, fixed-structure control elements distributed over one or more feedback loops. For an overview of the tuning workflow, seeAutomated Tuning Workflow

This command tunes control systems modeled in Simulink®。For tuning control systems represented in MATLAB®, usesystuneforgenssmodels.

example

[st,fSoft] = systune(st0,SoftGoals)tunes the free parameters of the control system in Simulink. The Simulink model,tuned blocks, andanalysis pointsof interest are specified by theslTunerinterface,st0systunetunes the control system parameters to best meet the performance goals,SoftGoals。The command returns a tuned version ofst0asst。The best achieved soft constraint values are returned asfSoft

If thest0contains real parameter uncertainty,systuneautomatically performs robust tuning to optimize the constraint values for worst-case parameter values.systunealso performs robust tuning against a set of plant models obtained at different operating points or parameter values. SeeInput Arguments

Tuning is performed at the sample time specified by theTsproperty ofst0

[st,fSoft,gHard] = systune(st0,SoftGoals,HardGoals)tunes the control system to best meet the soft goals, subject to satisfying the hard goals. It returns the best achieved values,fSoftandgHard, for the soft and hard goals. A goal is met when its achieved value is less than 1.

[st,fSoft,gHard] = systune(___,opt)specifies options for the optimization for any of the input argument combinations in previous syntaxes.

[st,fSoft,gHard,info] = systune(___)also returns detailed information about each optimization run for any of the input argument combinations in previous syntaxes.

Examples

collapse all

Tune the control system in therct_airframe2model to soft goals for tracking, roll off, stability margin, and disturbance rejection.

Open the Simulink model.

mdl ='rct_airframe2'; open_system(mdl);

Create and configure anslTunerinterface to the model.

st0 = slTuner(mdl,'MIMO Controller');

st0is anslTunerinterface to therct_aircraft2model with theMIMO Controllerblock specified as the tunable portion of the control system.

The model already has linearization input points on the signalsaz ref,delta fin,az,q, ande。These signals are therefore available as analysis points for tuning goals and linearization.

指定跟踪要求,转出ment, stability margins, and disturbance rejection requirement.

req1 = TuningGoal.Tracking('az ref','az',1); req2 = TuningGoal.Gain('delta fin','delta fin',tf(25,[1 0])); req3 = TuningGoal.Margins('delta fin',7,45); max_gain = frd([2 200 200],[0.02 2 200]); req4 = TuningGoal.Gain('delta fin','az',max_gain);

req1constrainsazto trackaz ref。The next requirement,req2, imposes a roll-off requirement by specifying a gain profile for the open-loop, point-to-point transfer function measured atdelta fin。The next requirement,req3, imposes open-loop gain and phase margins on that same point-to-point transfer function. Finally,req4rejects disturbances toazinjected atdelta fin, by specifying a maximum gain profile between those two points.

Tune the model using these tuning goals.

opt = systuneOptions('RandomStart',3); rng(0); [st,fSoft,~,info] = systune(st0,[req1,req2,req3,req4],opt);
Final: Soft = 1.14, Hard = -Inf, Iterations = 68 Final: Soft = 1.13, Hard = -Inf, Iterations = 75 Final: Soft = 1.13, Hard = -Inf, Iterations = 72 Final: Soft = 40, Hard = -Inf, Iterations = 82

stis a tuned version ofst0

TheRandomStartoption specifies thatsystunemust perform three independent optimization runs that use different (random) initial values of the tunable parameters. These three runs are in addition to the default optimization run that uses the current value of the tunable parameters as the initial value. The call torngseeds the random number generator to produce a repeatable sequence of numbers.

systunedisplays the final result for each run. The displayed value,Soft, is the maximum of the values achieved for each of the four performance goals. The software chooses the best run overall, which is the run yielding the lowest value ofSoft。最后未能实现闭环stabil运行ity, which corresponds toSoft = Inf

Examine the best achieved values of the soft constraints.

fSoft
fSoft = 1.1327 1.1327 0.5140 1.1327

Onlyreq3, the stability margin requirement, is met for all frequencies. The other values are close to, but exceed, 1, indicating violations of the goals for at least some frequencies.

UseviewGoalto visualize the tuned control system performance against the goals and to determine whether the violations are acceptable. To evaluate specific open-loop or closed-loop transfer functions for the tuned parameter values, you can use linearization commands such asgetIOTransferandgetLoopTransfer。After validating the tuned parameter values, if you want to apply these values to the Simulink® model, you can usewriteBlockValue

Input Arguments

collapse all

Interface for tuning control systems modeled in Simulink, specified as anslTunerinterface.

If you specify parameter variation or linearization at multiple operating points when you createst0, thensystuneperforms robust tuning against all the plant models. If you specify an uncertain (uss(Robust Control Toolbox)) model as a block substitution when you createst0, thensystuneperforms robust tuning, optimizing the parameters against the worst-case parameter values. For more information about robust tuning approaches, seeRobust Tuning Approaches(Robust Control Toolbox)。(Using uncertain models requires a Robust Control Toolbox™ license.)

Soft goals (objectives) for tuning the control system described byst0, specified as a vector ofTuningGoalobjects. For a complete list, seeTuning Goals

systunetunes the tunable parameters of the control system to minimize the maximum value of the soft tuning goals, subject to satisfying the hard tuning goals (if any).

Hard goals (constraints) for tuning the control system described byst0, specified as a vector ofTuningGoalobjects. For a complete list, seeTuning Goals

A hard goal is satisfied when its value is less than 1.systunetunes the tunable parameters of the control system to minimize the maximum value of the soft tuning goals, subject to satisfying all the hard tuning goals.

Tuning algorithm options, specified as an options set created usingsystuneOptions

Available options include:

  • Number of additional optimizations to run starting from random initial values of the free parameters

  • Tolerance for terminating the optimization

  • Flag for using parallel processing

See thesystuneOptionsreference page for more details about all available options.

Output Arguments

collapse all

Tuned interface, returned as anslTunerinterface.

Best achieved values of soft goals, returned as a vector.

Each tuning goal evaluates to a scalar value, andsystuneminimizes the maximum value of the soft goals, subject to satisfying all the hard goals.

fSoftcontains the value of each soft goal for the best overall run. The best overall run is the run that achieved the smallest value formax(fSoft), subject tomax(gHard)<1

Achieved values of hard goals, returned as a vector.

gHardcontains the value of each hard goal for the best overall run (the run that achieved the smallest value formax(fSoft), subject tomax(gHard)<1。All entries ofgHardare less than 1 when all hard goals are satisfied. Entries greater than 1 indicate thatsystunecould not satisfy one or more design constraints.

Detailed information about each optimization run, returned as a data structure. The fields ofinfoare summarized in the following table.

Field Value
Run

Run number, returned as a scalar. If you use theRandomStartoption ofsystuneOptionsto perform multiple optimization runs,infois a structure array, andinfo.Runis the index.

Iterations

Total number of iterations performed during the run, returned as a scalar. If you useRandomStart,info.Iterations(j)is the number of iterations performed in thejth run before termination.

f

Best overall soft constraint value, returned as a scalar.systuneconverts the soft tuning goals to a function of the free parameters of the control system. The command then tunes the parameters to minimize that function subject to the hard goals. (SeeAlgorithms。)info.fis the maximum soft goal value at the final iteration. This value is meaningful only when the hard goals are satisfied. If the value is less than 1, then the soft goals are also attained.

g

Best overall hard constraint value, returned as a scalar.systuneconverts the hard tuning goals to a function of the free parameters of the control system. The command then tunes the parameters to drive those values below 1. (SeeAlgorithms。)info.gis the largest hard goal value at the final iteration. If this value is less than 1, then the hard goals are satisfied.

x

Tuned parameter values, returned as a vector. This vector contains the values of the tunable parameters at the end of the run.info.xcan also include the values of additional variables such as loop scalings, ifsystuneuses them (seeinfo.LoopScaling).

MinDecay

最小衰减率的调谐系统动力学,回报ned as a two-element row vector.

info.MinDecay(1)is the minimum decay rate of the closed-loop poles.

info.MinDecay(2)is the minimum decay rate of the dynamics of tuned blocks with stability constraints. For more information about stabilized dynamics and decay rates, see theMinDecayoption ofsystuneOptions

fSoft

Individual soft constraint values, returned as a vector.systuneconverts each soft tuning goal to a normalized value that is a function of the free parameters of the control system. The command then tunes the parameters to minimize that value subject to the hard goals. (SeeAlgorithms。)info.fSoftcontains the individual values of the soft goals at the end of each run. These values appear infSoftin the same order in which you specify goals in theSoftReqsinput argument tosystune

gHard

Individual hard constraint values, returned as a vector.systuneconverts each hard tuning goal to a normalized value that is a function of the free parameters of the control system. The command then tunes the parameters to minimize those values. A hard goal is satisfied if its value is less than 1. (SeeAlgorithms。)info.gHardcontains the individual values of the hard goals at the end of each run. These values appear ingHardin the same order in which you specify goals in theHardReqsinput argument tosystune

Blocks

Tuned values of tunable blocks and parameters in the tuned control system, returned as a structure whose fields are the names of tunable elements and whose values are the corresponding tuned values.

When you perform multiple runs by setting theRandomStartoption to a positive value, you can use this field to examine control system performance with the results from other runs. For instance, use the following code to apply the tuned values from thejth run.

stj = setBlockValue(st0,info(j).Blocks)

LoopScaling

Optimal diagonal scaling for evaluating MIMO tuning requirements, returned as a state-space model.

When applied to multiloop control systems, tuning goals that involve an open-loop response can be sensitive to the scaling of the loop transfer functions to which they apply. This sensitivity can lead to poor optimization results.systuneautomatically corrects scaling issues and returns the optimal diagonal scaling matrixDas a state-space model ininfo.LoopScaling

The loop channels associated with each diagonal entry ofDare listed ininfo.LoopScaling.InputName。The scaled loop transfer isD\L*D, whereLis the open-loop transfer measured at the locationsinfo.LoopScaling.InputName

Tuning goals affected by such loop scaling include:

  • TuningGoal.LoopShape

  • TuningGoal.MinLoopGainandTuningGoal.MaxLoopGain

  • TuningGoal.Sensitivity

  • TuningGoal.Rejection

  • TuningGoal.Margins

infoalso contains the following fields, whose entries are meaningful when you usesystunefor robust tuning of control systems with uncertainty.

Field Value
wcPert

Worst combinations of uncertain parameters, returned as a structure array. Each structure contains one set of uncertain parameter values. The perturbations with the worst performance are listed first.

wcf

Worst soft-goal value, returned as a scalar. This value is the largest soft goal value (f) over the uncertainty range when using the tuned controller.

wcg

Worst hard-goal value, returned as a scalar. This value is the largest hard goal value (g) over the uncertainty range when using the tuned controller.

wcDecay

Smallest closed-loop decay rate over the uncertainty range when using the tuned controller, returned as a scalar. A positive value indicates robust stability. For more information about stabilized dynamics and decay rates, see theMinDecayoption ofsystuneOptions

More About

collapse all

Tuned Blocks

Tuned blocks, used by theslTunerinterface, identify blocks in a Simulink model whose parameters are to be tuned to satisfy tuning goals. You can tune most Simulink blocks that represent linear elements such as gains, transfer functions, or state-space models. (For the complete list of blocks that support tuning, seeHow Tuned Simulink Blocks Are Parameterized). You can also tune more complex blocks such as SubSystem or S-Function blocks by specifying an equivalenttunable linear model

Use tuning commands such assystuneto tune the parameters of tuned blocks.

You must specify tuned blocks (for example,C1andC2) when you create anslTunerinterface.

st = slTuner('scdcascade',{“C1”,'C2'})

You can modify the list of tuned blocks usingaddBlockandremoveBlock

To interact with the tuned blocks use:

Analysis Points

Analysis points, used by theslLinearizerandslTunerinterfaces, identify locations within a model that are relevant for linear analysis and control system tuning. You use analysis points as inputs to the linearization commands, such asgetIOTransfer,getLoopTransfer,getSensitivity, andgetCompSensitivity。As inputs to the linearization commands, analysis points can specify any open-loop or closed-loop transfer function in a model. You can also use analysis points to specify design requirements when tuning control systems using commands such assystune

Locationrefers to a specific block output port within a model or to a bus element in such an output port. For convenience, you can use the name of the signal that originates from this port to refer to an analysis point.

You can add analysis points to anslLinearizerorslTunerinterface,s, when you create the interface. For example:

s = slLinearizer('scdcascade',{'u1','y1'});

Alternatively, you can use theaddPointcommand.

To view all the analysis points ofs, typesat the command prompt to display the interface contents. For each analysis point ofs, the display includes the block name and port number and the name of the signal that originates at this point. You can also programmatically obtain a list of all the analysis points usinggetPoints

For more information about how you can use analysis points, seeMark Signals of Interest for Control System Analysis and DesignandMark Signals of Interest for Batch Linearization

Algorithms

xis the vector of tunable parameters in the control system to tune.systuneconverts each soft and hard tuning requirementSoftReqs(i)andHardReqs(j)into normalized valuesfi(x) andgj(x), respectively.systunethen solves the constrained minimization problem:

Minimize max i f i ( x ) subject to max j g j ( x ) < 1 , for x min < x < x max

xminandxmax主要的最小值和最大值呢e parameters of the control system.

When you use both soft and hard tuning goals, the software approaches this optimization problem by solving a sequence of unconstrained subproblems of the form:

min x max ( α f ( x ) , g ( x ) )

The software adjusts the multiplierαso that the solution of the subproblems converges to the solution of the original constrained optimization problem.

systunereturns theslTunerinterfacewith parameters tuned to the values that best solve the minimization problem.systunealso returns the best achieved values offi(x) andgj(x), asfSoftandgHardrespectively.

For information about the functionsfi(x) andgj(x) for each type of constraint, see the reference pages for eachTuningGoalrequirement object.

systuneuses the nonsmooth optimization algorithms described in[1],[2],[3],[4]

systunecomputes theHnorm using the algorithm of[5]and structure-preserving eigensolvers from the SLICOT library. For information about the SLICOT library, seehttp://slicot.org

Alternative Functionality

Tune interactively usingControl System Tuner

References

[1] P. Apkarian and D. Noll, "Nonsmooth H-infinity Synthesis,"IEEE Transactions on Automatic Control, Vol. 51, Number 1, 2006, pp. 71–86.

[2] Apkarian, P. and D. Noll, "Nonsmooth Optimization for Multiband Frequency-Domain Control Design,"Automatica, 43 (2007), pp. 724–731.

[3] Apkarian, P., P. Gahinet, and C. Buhr, "Multi-model, multi-objective tuning of fixed-structure controllers,"Proceedings ECC(2014), pp. 856–861.

[4] Apkarian, P., M.-N. Dao, and D. Noll, "Parametric Robust Structured Control Design,"IEEE Transactions on Automatic Control, 2015.

[5] Bruinsma, N.A., and M. Steinbuch. "A Fast Algorithm to Compute the HNorm of a Transfer Function Matrix."Systems & Control Letters, 14, no.4 (April 1990): 287–93.

Extended Capabilities

Version History

Introduced in R2014a