CohenCoon - MapleSim Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

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}\left[1\right],\mathrm{Params1}\left[2\right],\mathrm{Params1}\left[3\right],'\mathrm{controller}'=P\right)$
 ${\mathrm{Pgain}}{≔}\left[{17.01539475}\right]$ (2)
 > $\mathrm{PIgains}≔\mathrm{CohenCoon}\left(\mathrm{Params1}\left[1\right],\mathrm{Params1}\left[2\right],\mathrm{Params1}\left[3\right],'\mathrm{controller}'=\mathrm{\Pi }\right)$
 ${\mathrm{PIgains}}{≔}\left[{12.52745528}{,}{11.47249211}\right]$ (3)
 > $\mathrm{PDgains}≔\mathrm{CohenCoon}\left(\mathrm{Params1}\left[1\right],\mathrm{Params1}\left[2\right],\mathrm{Params1}\left[3\right],'\mathrm{controller}'=\mathrm{PD}\right)$
 ${\mathrm{PDgains}}{≔}\left[{17.82548949}{,}{2.753995614}\right]$ (4)
 > $\mathrm{PIDgains}≔\mathrm{CohenCoon}\left(\mathrm{Params1}\left[1\right],\mathrm{Params1}\left[2\right],\mathrm{Params1}\left[3\right],'\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}\left[1\right],\mathrm{Params1}\left[2\right],\mathrm{Params1}\left[3\right],'\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}\left[1\right],\mathrm{Params1}\left[2\right],\mathrm{Params1}\left[3\right],'\mathrm{controller}'=\mathrm{PID},'\mathrm{returntype}'=\mathrm{system}\right):$
 > $\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{{a}}{{12}}{,}\frac{\sqrt{\left|\frac{{{a}}^{{2}}}{{144}}{-}{1}\right|}}{{a}}{,}\frac{\left|\frac{{-}{12}{+}{5}{}{a}{-}{12}{}\sqrt{\left|\frac{{{a}}^{{2}}}{{144}}{-}{1}\right|}}{{a}}\right|{}{\left|{a}\right|}^{{2}}{+}\left|\sqrt{{2}}{}\sqrt{\left|{13}{}{{a}}^{{2}}{-}{72}{}\left|\frac{{{a}}^{{2}}}{{144}}{-}{1}\right|{-}{60}{}{a}\right|}{}{a}{-}{12}{}\sqrt{\left|\frac{{{a}}^{{2}}}{{144}}{-}{1}\right|}{}\left|{a}\right|\right|}{{24}{}{\left|{a}\right|}^{{2}}}\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(\mathrm{eval}\left(\mathrm{PIDparams}:-K,a=1\right)\right)$
 ${20.21678292}$ (9)
 > $\mathrm{evalf}\left(\mathrm{eval}\left(\mathrm{PIDparams}:-\mathrm{Ti},a=1\right)\right)$
 ${1.762784060}$ (10)
 > $\mathrm{evalf}\left(\mathrm{eval}\left(\mathrm{PIDparams}:-\mathrm{Td},a=1\right)\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(\mathrm{eval}\left(\mathrm{PIDgains}:-\mathrm{Kp},a=1\right)\right)$
 ${20.21678292}$ (12)
 > $\mathrm{evalf}\left(\mathrm{eval}\left(\mathrm{PIDgains}:-\mathrm{Ki},a=1\right)\right)$
 ${11.46866674}$ (13)
 > $\mathrm{evalf}\left(\mathrm{eval}\left(\mathrm{PIDgains}:-\mathrm{Kd},a=1\right)\right)$
 ${5.925668009}$ (14)

References

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