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

ControlDesign

 ZNTimeModified
 PID tuning based on Ziegler-Nichols time domain (open-loop) methods

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

Parameters

 Kt - algebraic or non-zero realcons; gain of the FOTD (First order with Time Delay) 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 ZNTimeModified command

Options

 • method = MZN or AMIGO
 Specifies the tuning method. MZN uses a modified version of the open loop Ziegler-Nichols tuning method based on the FOTD model. The AMIGO method calculates the controller gains using the AMIGO tuning rule and does not apply to the P controller. The default is MZN.
 • controller = P, PI or PID for the MZN method; PI or PID for the AMIGO method.
 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 ZNTimeModified command calculates the controller gains based on the Ziegler-Nichols time domain (open-loop) tuning methods as specified in the options, using the given  first order time delay model parameters.
 • The ZNTimeModified command returns a list of controller gains $\mathrm{Kp}$, $\mathrm{Ki}$ and $\mathrm{Kd}$ according to the selected controller type P, PI or PID, respectively, 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}$
 – 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{sys}≔\mathrm{NewSystem}\left(\frac{2.5}{{s}^{2}+3s+5}\right):$

Identify the parameters [$\mathrm{Kt}$, $T$, $L$] of sys

 > $\mathrm{Params}≔\mathrm{ParameterIdentify}:-\mathrm{TimeDomain}\left(\mathrm{sys}\right)$
 ${\mathrm{Params}}{≔}\left[{0.5000000000}{,}{0.2000000000}{,}{0.3645751311}\right]$ (1)

Calculate the controller parameters using the MZN method

 > $\mathrm{ZNTimeModified}\left(\mathrm{Params}\left[1\right],\mathrm{Params}\left[2\right],\mathrm{Params}\left[3\right],'\mathrm{method}'=\mathrm{MZN},'\mathrm{controller}'=P\right)$
 $\left[{1.097167540}\right]$ (2)
 > $\mathrm{ZNTimeModified}\left(\mathrm{Params}\left[1\right],\mathrm{Params}\left[2\right],\mathrm{Params}\left[3\right],'\mathrm{method}'=\mathrm{MZN},'\mathrm{controller}'=\mathrm{\Pi }\right)$
 $\left[{0.9874507860}{,}{0.9028324590}\right]$ (3)
 > $\mathrm{pid}≔\mathrm{ZNTimeModified}\left(\mathrm{Params}\left[1\right],\mathrm{Params}\left[2\right],\mathrm{Params}\left[3\right],'\mathrm{method}'=\mathrm{MZN},'\mathrm{controller}'=\mathrm{PID},'\mathrm{factored}'=\mathrm{true},'\mathrm{returntype}'=\mathrm{record}\right)$
 ${\mathrm{pid}}{≔}{{\mathrm{Record}}}_{{\mathrm{packed}}}{}\left({K}{=}{1.316601048}{,}{\mathrm{Ti}}{=}{0.7291502622}{,}{\mathrm{Td}}{=}{0.1822875656}\right)$ (4)
 > $\mathrm{pidsys}≔\mathrm{ZNTimeModified}\left(\mathrm{Params}\left[1\right],\mathrm{Params}\left[2\right],\mathrm{Params}\left[3\right],'\mathrm{method}'=\mathrm{MZN},'\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{{0.2399999999}{}{{s}}^{{2}}{+}{1.316601048}{}{s}{+}{1.805664917}}{{s}}\end{array}\right$ (5)

Calculate the controller parameters using the AMIGO method

The AMIGO method does not apply to the P controller

 > $\mathrm{ZNTimeModified}\left(\mathrm{Params}\left[1\right],\mathrm{Params}\left[2\right],\mathrm{Params}\left[3\right],'\mathrm{method}'=\mathrm{AMIGO},'\mathrm{controller}'=P\right)$
 > $\mathrm{PIpars}≔\mathrm{ZNTimeModified}\left(\mathrm{Params}\left[1\right],\mathrm{Params}\left[2\right],\mathrm{Params}\left[3\right],'\mathrm{method}'=\mathrm{AMIGO},'\mathrm{controller}'=\mathrm{\Pi },'\mathrm{returntype}'=\mathrm{record}\right)$
 ${\mathrm{PIpars}}{≔}{{\mathrm{Record}}}_{{\mathrm{packed}}}{}\left({\mathrm{Kp}}{=}{0.4330243721}{,}{\mathrm{Ki}}{=}{1.879995098}\right)$ (6)
 > $\mathrm{PIsys}≔\mathrm{ZNTimeModified}\left(\mathrm{Params}\left[1\right],\mathrm{Params}\left[2\right],\mathrm{Params}\left[3\right],'\mathrm{method}'=\mathrm{AMIGO},'\mathrm{controller}'=\mathrm{\Pi },'\mathrm{returntype}'=\mathrm{system}\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{PIsys}\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{{0.4330243721}{}{s}{+}{1.879995098}}{{s}}\end{array}\right$ (7)
 > $\mathrm{ZNTimeModified}\left(\mathrm{Params}\left[1\right],\mathrm{Params}\left[2\right],\mathrm{Params}\left[3\right],'\mathrm{method}'=\mathrm{AMIGO},'\mathrm{controller}'=\mathrm{PID}\right)$
 $\left[{0.8937253934}{,}{3.082606536}{,}{0.1053196425}\right]$ (8)

References

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