gives a feedback PID controller for the linear time-invariant system lsys.


gives a controller of architecture "carch" ("P", "PI", "PID", etc).


gives a controller using the tuning rule "trule".


returns the value for the property "prop".

Details and Options

  • PIDTune will produce a PID controller gfb such that the closed-loop system csys is good at rejecting disturbances as well as follow changes in the reference .
  • The ideal PID controller effectively computes the control signal through with proportional, integral, and derivative terms.
  • By default, the transfer function representing gfb is returned.
  • The system lsys can be a continuous-time linear SISO system, such as TransferFunctionModel, StateSpaceModel, etc.
  • The following controller architectures "carch" can be used:
  • "P"proportional
    "PI"proportional integral
    "PD"proportional derivative
    "PID"proportional integral derivative
    "PFD""PD" with filtered derivative part
    "PIFD""PID" with filtered derivative part
  • By default, a "PI" controller is chosen.
  • The tuning rule "trule" is chosen automatically, unless explicitly specified, based on stability properties of the system lsys.
  • The following tuning rules "trule" can be used:
  • "AMIGO"approximate -constrained integral gain optimization
    "AMIGOFrequency""AMIGO" from frequency response
    "ChienHronesReswick"uses rules based on step response
    "CohenCoon"dominant pole placement for amplitude decay ratio 0.25
    "DisturbanceRejection"minimizes infinity norm of disturbance response
    "ErrorIntegral"minimizes an integral of error
    "KappaTau"dominant pole placement
    "KappaTauFrequency"dominant pole placement from frequency response
    "LambdaTuning"uses internal model control
    "LoopShaping"exact "AMIGO"
    "SkogestadIMC"uses internal model control based on half-rule reduction
    "TyreusLuyben"uses rules based on frequency response
    "ZieglerNichols"uses rules based on step response
    "ZieglerNicholsFrequency"uses rules based on frequency response
  • PIDTune[lsys,,"PIDData"] returns a PIDData object pid that can be used to extract additional properties using the form pid["property"].
  • PIDTune[lsys,,"property"] can be used to directly give the value of pid["property"].
  • PIDTune can optionally compute a feedforward filter gff to improve tracking of the reference independently of disturbance rejection capabilities of the feedback controller gfb.
  • The feedforward weights b and c affect what fraction of the reference signal is provided to the different terms of the PID controller. The resulting controller is effectively given by , but provided as a separate feedforward filter gff having same effect when combined with the feedback controller gfb.
  • Properties related to different transfer functions include:
  • "Feedback"feedback gfb
    "Feedforward"feedforward gff
    "OpenLoop"series connection of gfb and lsys
    "DisturbanceOutput"transfer function from to
    "DisturbanceControl"transfer function from to
    "ReferenceOutput"transfer function from to
    "ReferenceControl"transfer function from to
    "SensorOutput"transfer function from to
    "SensorControl"transfer function from to
    "ISA"transfer function from and to
  • Properties related to parametrizations of transfer functions:
  • "FeedbackIdealParameters"{kp,ti,td} in
    "FeedbackSeriesParameters"{kps,tis,tds} in
    "FeedbackParallelParameters"{kpp,kip,kdp} in
    "FeedforwardParameters"{b,c} in the gff
    "DerivativeFilterParameter"n controlling derivative filters in gff and gfb
  • The derivative filter replaces the direct derivative with its filtered version , effectively series connecting a lowpass filter with the derivative.
  • Properties related to tuning rule and internal tuning model for lsys:
  • "TuningRule"chosen tuning rule
    "TuningModel"model and parameters {"tmodel",{par1,}}
  • The possible tuning models and parameters:
  • {"FOPTD2",{kv,l}}first order plus time delay
    {"FOPTD3",{ks,l,tc}first order plus time delay
    {"Frequency2",{ku,tu}}ultimate gain and ultimate period
    {"Frequency3",{ku,tu,ks}ultimate gain, ultimate period, and static gain
    {"SOPTD",{ks,l,tc1,tc2}}second-order plus time delay
  • The parameters are static gain , velocity constant , delay , time constants , ultimate gain and ultimate period .
  • PIDTune also accepts a nonlinear system specified by AffineStateSpaceModel or NonlinearStateSpaceModel, for which the controller computations use the approximate Taylor linearization and the simulations use the nonlinear system.
  • The following options can be given:
  • PIDFeedforwardNonereference weights for gff
    PIDDerivativeFilterNonefiltered derivative
    MethodAutomaticmethods to use
  • The settings for Method control the parameter estimation method used to derive the tuning models.
  • Possible settings for Method include:
  • Automaticautomatically choose the estimation method
    "CharacteristicArea"use the characteristic area of the step response
    "GainMargins"use the phase crossover frequency and gain margin
    "InflectionPoint"use the inflection point of the step response
    "MethodOfMoments"match moments
    "TwoPointSampling"use the 28% and 63% points of the step response


open all close all

Basic Examples  (2)

Tune a PI controller:

Click for copyable input

A PID controller:

Click for copyable input

Tune a PI controller using a specific tuning rule:

Click for copyable input
Click for copyable input

Scope  (17)

Options  (4)

Applications  (4)

Properties & Relations  (2)

Possible Issues  (1)

Introduced in 2012
Updated in 2014