ControlDesign

 CohenCoon
 PID tuning based on Cohen-Coon method

 Calling Sequence CohenCoon(Kt, T, L, opts)

Parameters

 Kt - algebraic or non-zero realcons; gain of the first-order with time-delay (FOTD) model T - algebraic or positive realcons; time constant of the FOTD model L - algebraic or positive realcons; time delay of the FOTD model opts - (optional) equation(s) of the form option = value; specify options for the CohenCoon command

Options

 • controller = P, PI, PD, or PID
 Specifies the controller type. The default value is PID.
 • factored  = true or false
 True means return the factored version of the controller gains ($K=\mathrm{Kp}$, $\mathrm{Ti}=\frac{\mathrm{Kp}}{\mathrm{Ki}}$, $\mathrm{Td}=\frac{\mathrm{Kd}}{\mathrm{Kp}}$). False means return the controller gains ($\mathrm{Kp}$, $\mathrm{Ki}$, $\mathrm{Kd}$). The default is false.
 • returntype =  list or record or system
 Specifies the returned type. If list (or record) is specified, a list (or record) containing the controller parameters is returned. If system is specified, a System (DynamicSystems system object) containing the transfer function of the specified controller type (P, PI, PID) is returned. The default value is list.

Description

 • The CohenCoon command calculates the controller gains based on the Cohen-Coon tuning method using the given first-order time-delay model parameters.
 • The CohenCoon command returns a list of controller gains $\mathrm{Kp}$, $\mathrm{Ki}$ and $\mathrm{Kd}$ according to the selected controller type (P, PI, PD, PID), where $\mathrm{Kp}$ is the proportional gain, $\mathrm{Ki}$ is the integral gain, and $\mathrm{Kd}$ is the derivative gain.
 • The controller transfer function is then obtained as:
 – P: $C\left(s\right)=\mathrm{Kp}$
 – PI: $C\left(s\right)=\mathrm{Kp}+\frac{\mathrm{Ki}}{s}$
 – PD: $C\left(s\right)=\mathrm{Kd}s+\mathrm{Kp}$
 – PID: $C\left(s\right)=\mathrm{Kp}+\frac{\mathrm{Ki}}{s}+\mathrm{Kd}s$

Examples

 > $\mathrm{with}\left(\mathrm{ControlDesign}\right):$
 > $\mathrm{with}\left(\mathrm{DynamicSystems}\right):$
 > $\mathrm{sys1}≔\mathrm{NewSystem}\left(\frac{s+1}{{s}^{2}+5s+12}\right):$
 > $\mathrm{Params1}≔\mathrm{evalf}\left(\mathrm{ParameterIdentify}:-\mathrm{TimeDomain}\left(\mathrm{sys1}\right)\right)$
 ${\mathrm{Params1}}{:=}\left[{0.08333333333}{,}{0.9965217283}{,}{0.9331168468}\right]$ (1)

Calculate the gains for controller types P, PI, PD, and PID.

 > $\mathrm{Pgain}≔\mathrm{CohenCoon}\left({\mathrm{Params1}}_{1},{\mathrm{Params1}}_{2},{\mathrm{Params1}}_{3},'\mathrm{controller}'=P\right)$
 ${\mathrm{Pgain}}{:=}\left[{17.01539475}\right]$ (2)
 > $\mathrm{PIgains}≔\mathrm{CohenCoon}\left({\mathrm{Params1}}_{1},{\mathrm{Params1}}_{2},{\mathrm{Params1}}_{3},'\mathrm{controller}'=\mathrm{Π}\right)$
 ${\mathrm{PIgains}}{:=}\left[{12.52745528}{,}{11.47249211}\right]$ (3)
 > $\mathrm{PDgains}≔\mathrm{CohenCoon}\left({\mathrm{Params1}}_{1},{\mathrm{Params1}}_{2},{\mathrm{Params1}}_{3},'\mathrm{controller}'=\mathrm{PD}\right)$
 ${\mathrm{PDgains}}{:=}\left[{17.82548949}{,}{2.753995614}\right]$ (4)
 > $\mathrm{PIDgains}≔\mathrm{CohenCoon}\left({\mathrm{Params1}}_{1},{\mathrm{Params1}}_{2},{\mathrm{Params1}}_{3},'\mathrm{controller}'=\mathrm{PID}\right)$
 ${\mathrm{PIDgains}}{:=}\left[{20.21678293}{,}{11.46866675}{,}{5.925668011}\right]$ (5)

Return a record containing the PID controller gains.

 > $\mathrm{PIDrec}≔\mathrm{CohenCoon}\left({\mathrm{Params1}}_{1},{\mathrm{Params1}}_{2},{\mathrm{Params1}}_{3},'\mathrm{controller}'=\mathrm{PID},'\mathrm{returntype}'=\mathrm{record}\right)$
 ${\mathrm{PIDrec}}{:=}{{\mathrm{Record}}}_{{\mathrm{packed}}}{}\left({\mathrm{Kp}}{=}{20.21678293}{,}{\mathrm{Ki}}{=}{11.46866675}{,}{\mathrm{Kd}}{=}{5.925668011}\right)$ (6)

Return a System (DynamicSystems system object) for the PID controller.

 > $\mathrm{PIDsys}≔\mathrm{CohenCoon}\left({\mathrm{Params1}}_{1},{\mathrm{Params1}}_{2},{\mathrm{Params1}}_{3},'\mathrm{controller}'=\mathrm{PID},'\mathrm{returntype}'=\mathrm{system}\right):$
 Warning, improper transfer-function, degree(num) > degree(den)
 > $\mathrm{PrintSystem}\left(\mathrm{PIDsys}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{5.925668011}{}{{s}}^{{2}}{+}{20.21678293}{}{s}{+}{11.46866675}}{{s}}\end{array}\right$ (7)
 > $\mathrm{sys2}≔\mathrm{NewSystem}\left(\frac{s+a}{{s}^{2}+5s+12}\right):$
 > $\mathrm{Params2}≔\mathrm{ParameterIdentify}:-\mathrm{TimeDomain}\left(\mathrm{sys2}\right)$
 ${\mathrm{Params2}}{:=}\left[\frac{{1}}{{12}}{}{a}{,}\frac{{12}{}\sqrt{\left|\frac{{1}}{{20736}}{}{{a}}^{{2}}{-}\frac{{1}}{{144}}\right|}}{{a}}{,}\frac{{1}}{{24}}{}\left|\frac{{12}{-}{5}{}{a}{+}{144}{}\sqrt{\left|\frac{{1}}{{20736}}{}{{a}}^{{2}}{-}\frac{{1}}{{144}}\right|}}{{a}}\right|{+}\frac{{1}}{{24}}{}\left|\frac{\sqrt{{2}}{}\sqrt{\left|\frac{{-}{13}{}{{a}}^{{2}}{+}{10368}{}\left|\frac{{1}}{{20736}}{}{{a}}^{{2}}{-}\frac{{1}}{{144}}\right|{+}{60}{}{a}}{{{a}}^{{2}}}\right|}{}{a}{-}{144}{}\sqrt{\left|\frac{{1}}{{20736}}{}{{a}}^{{2}}{-}\frac{{1}}{{144}}\right|}}{{a}}\right|\right]$ (8)

Return a record containing the PID controller parameters in factored form.

 > $\mathrm{PIDparams}≔\mathrm{CohenCoon}\left(\mathrm{op}\left(\mathrm{Params2}\right),'\mathrm{controller}'=\mathrm{PID},'\mathrm{factored}'=\mathrm{true},'\mathrm{returntype}'=\mathrm{record}\right):$
 > $\mathrm{evalf}\left(\genfrac{}{}{0}{}{\mathrm{PIDparams}:-K}{\phantom{a=1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{PIDparams}:-K}}{a=1}\right)$
 ${20.21678291}$ (9)
 > $\mathrm{evalf}\left(\genfrac{}{}{0}{}{\mathrm{PIDparams}:-\mathrm{Ti}}{\phantom{a=1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{PIDparams}:-\mathrm{Ti}}}{a=1}\right)$
 ${1.762784060}$ (10)
 > $\mathrm{evalf}\left(\genfrac{}{}{0}{}{\mathrm{PIDparams}:-\mathrm{Td}}{\phantom{a=1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{PIDparams}:-\mathrm{Td}}}{a=1}\right)$
 ${0.2931063776}$ (11)

Return a record containing the PID controller gains.

 > $\mathrm{PIDgains}≔\mathrm{CohenCoon}\left(\mathrm{op}\left(\mathrm{Params2}\right),'\mathrm{controller}'=\mathrm{PID},'\mathrm{returntype}'=\mathrm{record}\right):$
 > $\mathrm{evalf}\left(\genfrac{}{}{0}{}{\mathrm{PIDgains}:-\mathrm{Kp}}{\phantom{a=1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{PIDgains}:-\mathrm{Kp}}}{a=1}\right)$
 ${20.21678291}$ (12)
 > $\mathrm{evalf}\left(\genfrac{}{}{0}{}{\mathrm{PIDgains}:-\mathrm{Ki}}{\phantom{a=1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{PIDgains}:-\mathrm{Ki}}}{a=1}\right)$
 ${11.46866674}$ (13)
 > $\mathrm{evalf}\left(\genfrac{}{}{0}{}{\mathrm{PIDgains}:-\mathrm{Kd}}{\phantom{a=1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{PIDgains}:-\mathrm{Kd}}}{a=1}\right)$
 ${5.925668008}$ (14)

References

 [1] K. J. Astrom and T. Hagglund, Advanced PID Control, ISA, 2006.