design compensator using automated tuning methods
this example shows how to tune a compensator using automated tuning methods in control system designer.
select tuning method
to select an automated tuning method, in control system designer, click tuning methods.
select one of the following tuning methods:
pid tuning
— tune pid gains to balance performance and robustness or use classical tuning formulas.optimization based tuning
— optimize compensator parameters using design requirements implemented in graphical tuning and analysis plots (requires simulink® design optimization™ software).lqg design
— design a full-order stabilizing feedback controller as a linear-quadratic-gaussian (lqg) tracker.loop shaping
free-form structure
— find a full-order stabilizing feedback controller with a specified open-loop bandwidth or shape (requires robust control toolbox™ software).fixed structure
— tune a user-specified stabilizing feedback controller with a specified open-loop bandwidth or shape.
internal model control (imc) tuning
— obtain a full-order stabilizing feedback controller using the imc design method.
select compensator and loop to tune
in the dialog box for your selected tuning method, in the compensator section, select the compensator and loop to tune. you can use the compensator editor to specify your compensator structure. for more information, see .
compensator — select a compensator to tune from the drop-down list. the app displays the current compensator transfer function.
select loop to tune — select an existing open-loop transfer function to tune from the drop-down list. you can select any open-loop transfer function from the data browser that includes the selected compensator in series.
add new loop — create a new loop to tune. in the open-loop transfer function dialog box, select signals and loop openings to configure the loop transfer function.
note
for optimization-based tuning, you do not specify the compensator and loop to tune in this way. instead, you define the compensator structure and select compensator and prefilter parameters to optimize. for more information, see select tunable compensator elements (simulink design optimization).
the structure of the compensator is maintained as poles and zeros after tuning except when performing optimization-based tuning.
pid tuning
using control system designer, you can automatically tune any of the following pid controller types:
p — proportional-only control
i — integral-only control
pi — proportional-integral control
pd — proportional-derivative control
pdf — proportional-derivative control with a low-pass filter on the derivative term
pid — proportional-integral-derivative control
pidf — proportional-integral-derivative control with a low-pass filter on the derivative term
to open the pid tuning dialog box, in control system designer, click tuning methods, and select pid tuning.
robust response time
the robust response time algorithm automatically tunes pid parameters to balance performance and robustness. using the robust response time method, you can:
tune all parameters for any type of pid controller.
design for plants that are stable, unstable, or integrating.
to tune your compensator using this method:
in the pid tuning dialog box, in the specifications section, in the tuning method drop-down list, select
robust response time
.select a controller type. if you choose pd or pid, check design with first order derivative filter to design a pdf or pidf controller, respectively.
tip
adding derivative action to the controller gives the algorithm more freedom to achieve both adequate phase margin and faster response time.
in the design mode drop-down list, select one of the following:
time
— specify controller performance using time-domain parameters.response time — specify a faster or slower controller response time. to modify the response time by a factor of ten, use the left or right arrows.
transient behavior — specify the controller transient behavior. you can make the controller more aggressive at disturbance rejection or more robust against plant uncertainty.
frequency
— specify controller performance using frequency-domain parameters.bandwidth — specify the closed-loop bandwidth of the control system. to produce a faster response time, increase the bandwidth. to modify the bandwidth by a factor of ten, use the left or right arrows.
phase margin — specify a target phase margin for the system. to reduce overshoot and create a more robust controller, increase the phase margin.
to apply the specified controller design to the selected compensator, click update compensator.
note
if you previously specified the controller structure manually or using a different automated tuning method, that structure is lost when you click update compensator.
by default, the app automatically computes controller parameters for balanced performance and robustness. to revert to these default parameters at any time, click reset parameters.
classical design formulas
you can use classical pid design formulas to tune p, pi, pid, and pidf controllers. these design formulas:
require a stable or integrating plant. for more information about the effective plant seen by the compensator, see .
cannot tune the derivative filter. if you select a pidf controller, the classical design methods set the filter time constant to td/10, where td is the tuned derivative time.
to tune your compensator using a classical method:
in the pid tuning dialog box, in the specifications section, in the tuning method drop-down list, select
classical design formulas
.select a controller type.
tip
adding derivative action to the compensator gives the algorithm more freedom to achieve both adequate phase margin and faster response time.
in the design mode drop-down list, select a classical design formula.
approximate migo frequency response
— compute controller parameters using closed-loop, frequency-domain, approximate m-constrained integral gain optimization (see [1]).approximate migo step response
— compute controller parameters using open-loop, time-domain, approximate m-constrained integral gain optimization (see [1]).chien-hrones-reswick
— approximate the plant as a first-order model with a time delay, and compute pid parameters using a chien-hrones-reswick lookup table for 0% overshoot and disturbance rejection (see [2]).skogestad imc
— approximate the plant as a first-order model with a time delay, and compute pid parameters using skogestad design rules (see [3]).note
this method is different from selecting internal model control tuning as the full-order compensator tuning method.
ziegler-nichols frequency response
— compute controller parameters from a ziegler-nichols lookup table, based on the ultimate gain and frequency of the system (see [2]).ziegler-nichols step response
— approximate the plant as a first-order model with a time delay, and compute pid parameters using the ziegler-nichols design method (see [2]).
apply the specified controller design to the selected compensator. click update compensator.
note
if you previously specified the controller structure manually or using a different automated tuning method, that structure is lost when you click update compensator.
optimization-based tuning
optimization-based tuning is available only if you have simulink design optimization software installed. you can use this method to design control systems for lti models by optimizing controller parameters.
note
optimization-based tuning only changes the values of controller parameters and not the controller structure itself. for information on adding or removing compensator elements, see .
to design a controller using optimization-based tuning:
define the structure of the compensators you want to tune. typically, you design an initial controller either manually or using a different automated tuning method.
open the response optimization dialog box. in control system designer, click tuning methods, and select optimization-based tuning.
select compensator parameters to optimize. on the compensators tab, in the optimize column, select the compensator elements to tune.
you can optimize elements for any compensator listed in the data browser.
any elements that you do not select in the optimize column remain at their current values during optimization.
for each compensator element, specify:
initial guess — starting point for the optimization algorithm. to use the current element value as the initial guess, click a row in the table, and click use value as initial guess.
minimum and maximum bounds on the element value. the optimization constrains the search results to the specified range.
typical value scaling factor for normalizing the compensator elements.
on the design requirements tab, in the optimize column, select the design requirements to satisfy during optimization.
each design requirement is associated with a plot of a specific response in the data browser.
for information on adding and editing design requirements, see .
(optional) configure optimization options. on the optimization tab, click optimization options.
click start optimization.
for examples of optimization-based tuning, see optimize lti system to meet frequency-domain requirements (simulink design optimization) and (simulink design optimization).
lqg design
linear-quadratic-gaussian (lqg) control is a technique for designing optimal dynamic regulators and setpoint trackers. this technique allows you to trade off performance and control effort, and to take into account process disturbances and measurement noise.
lqg synthesis generates a full-order feedback controller that guarantees closed-loop stability. the designed controller contains an integrator, which guarantees zero steady-state error for plants without a free differentiator.
to design an lqg controller:
open the lqg synthesis dialog box. in control system designer, click tuning methods, and select lqg synthesis.
specify the transient behavior of the controller using the controller response slider. you can make the controller more aggressive at disturbance rejection or more robust against plant uncertainty. if you believe your model is accurate and that the manipulated variable has a large enough range, an aggressive controller is preferable.
specify an estimate of the level of output measurement noise for your application using the measurement noise slider. to produce a more robust controller, specify a larger noise estimate.
specify your controller order preference using the desired controller order slider. the maximum controller order is dependent on the effective plant dynamics.
apply the specified controller design to the selected compensator. click update compensator.
note
if you previously specified the controller structure manually or using a different automated tuning method, that structure is lost when you click update compensator.
for an example of lqg synthesis using control system designer, see .
loop shaping
you can use loop shaping to design siso compensators in control system designer for free-form or fixed structure compensators. loop shaping to design free-form compensators requires a robust control toolbox license. loop shaping generates a stabilizing feedback controller to match, as closely as possible, a target loop shape. you can specify this loop shape as a bandwidth or an open-loop frequency response.
to design a controller using loop shaping:
open the loop shaping dialog box. in control system designer, click tuning methods, and select loop shaping.
select one of the following tuning preferences:
compensator structure — choose one of the following compensator structures:
free-form structure
— if you have robust control toolbox software installed, you can use a free-form compensator structure. use the desired controller order slider to specify your controller order preference. you can use the compensator editor to specify your compensator structure. for more information about the compensator editor, see .fixed structure
— when you selectfixed structure
, control system designer will use the supplied controller order to perform the automated loop shaping.
target bandwidth — specify a target open-loop bandwidth, , to produce a loop shape of the specified bandwidth over an integrator, .
target loop shape — specify the target open-loop shape as a , , or object. to limit the frequencies over which to match the target loop shape, specify the frequency range for loop shaping as a two-element row vector.
specify your controller order preference using the desired controller order slider when using a free-form compensator structure. the maximum controller order is dependent on the effective plant dynamics. when you use a fixed compensator structure, control system designer will use the supplied controller order to perform the automated loop shaping.
apply the specified controller design to the selected compensator. click update compensator.
note
if you previously specified the controller structure manually or using a different automated tuning method, that structure is lost when you click update compensator.
internal model control tuning
internal model control (imc) uses a predictive model of the plant dynamics to compute control actions. imc design generates a full-order feedback controller that guarantees closed-loop stability when there is no model error. the tuned compensator also contains an integrator, which guarantees zero steady-state offset for plants without a free differentiator. you can use this tuning method for both stable and unstable plants.
to design an imc controller:
select and configure the imc control architecture. in control system designer, click edit architecture.
in the edit architecture dialog box, select the fifth control architecture, and import the plant model, g1, predictive model, g2, and disturbance model gd.
click ok.
open the internal model control (imc) tuning dialog box. in control system designer, click tuning methods, and select internal model control (imc) tuning.
specify a dominant closed-loop time constant. the default value is 5% of the open-loop settling time. in general, increasing this value slows down the closed-loop system and makes it more robust.
specify your controller order preference using the desired controller order slider. the maximum controller order is dependent on the effective plant dynamics.
apply the specified controller design to the selected compensator. click update compensator.
note
if you previously specified the controller structure manually or using a different automated tuning method, that structure is lost when you click update compensator.
for an example of imc tuning, see .
references
[1] åström, k. j. and hägglund, t. “replacing the ziegler-nichols tuning rules.” chapter 7 in advanced pid control, research triangle park, nc: instrumentation, systems, and automation society, 2006, pp. 233–270.
[2] åström, k. j. and hägglund, t. “ziegler-nichols' and related methods.” section 6.2 in advanced pid control, research triangle park, nc: instrumentation, systems, and automation society, 2006, pp. 167–176.
[3] skogestad, s., “simple analytic rules for model reduction and pid controller tuning.” journal of process control, vol. 13, no. 4, 2003, pp. 291–309.