ControlDesign
CohenCoon
PID tuning based on Cohen-Coon method
Calling Sequence
Parameters
Options
Description
Examples
References
CohenCoon(Kt, T, L, opts)
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
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=Kp, Ti=KpKi, Td=KdKp). False means return the controller gains (Kp, Ki, 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.
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 Kp, Ki and Kd according to the selected controller type (P, PI, PD, PID), where Kp is the proportional gain, Ki is the integral gain, and Kd is the derivative gain.
The controller transfer function is then obtained as:
P: C⁡s=Kp
PI: C⁡s=Kp+Kis
PD: C⁡s=Kd⁢s+Kp
PID: C⁡s=Kp+Kis+Kd⁢s
with⁡ControlDesign:
with⁡DynamicSystems:
sys1≔NewSystem⁡s+1s2+5⁢s+12:
Params1≔evalf⁡ParameterIdentify:-TimeDomain⁡sys1
Params1≔0.08333333333,0.9965217283,0.9331168468
Calculate the gains for controller types P, PI, PD, and PID.
Pgain≔CohenCoon⁡Params11,Params12,Params13,controller=P
Pgain≔17.01539475
PIgains≔CohenCoon⁡Params11,Params12,Params13,controller=Π
PIgains≔12.52745528,11.47249211
PDgains≔CohenCoon⁡Params11,Params12,Params13,controller=PD
PDgains≔17.82548949,2.753995614
PIDgains≔CohenCoon⁡Params11,Params12,Params13,controller=PID
PIDgains≔20.21678293,11.46866675,5.925668011
Return a record containing the PID controller gains.
PIDrec≔CohenCoon⁡Params11,Params12,Params13,controller=PID,returntype=record
PIDrec≔Recordpacked⁡Kp=20.21678293,Ki=11.46866675,Kd=5.925668011
Return a System (DynamicSystems system object) for the PID controller.
PIDsys≔CohenCoon⁡Params11,Params12,Params13,controller=PID,returntype=system:
PrintSystem⁡PIDsys
Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=u1⁡soutputvariable=y1⁡stf1,1=5.925668011⁢s2+20.21678293⁢s+11.46866675s
sys2≔NewSystem⁡s+as2+5⁢s+12:
Params2≔ParameterIdentify:-TimeDomain⁡sys2
Params2≔a12,a2144−1a,−12+5⁢a−12⁢a2144−1a⁢a2+2⁢13⁢a2−72⁢a2144−1−60⁢a⁢a−12⁢a2144−1⁢a24⁢a2
Return a record containing the PID controller parameters in factored form.
PIDparams≔CohenCoon⁡op⁡Params2,controller=PID,factored=true,returntype=record:
evalf⁡eval⁡PIDparams:-K,a=1
20.21678292
evalf⁡eval⁡PIDparams:-Ti,a=1
1.762784060
evalf⁡eval⁡PIDparams:-Td,a=1
0.2931063776
PIDgains≔CohenCoon⁡op⁡Params2,controller=PID,returntype=record:
evalf⁡eval⁡PIDgains:-Kp,a=1
evalf⁡eval⁡PIDgains:-Ki,a=1
11.46866674
evalf⁡eval⁡PIDgains:-Kd,a=1
5.925668009
[1] K. J. Astrom and T. Hagglund, Advanced PID Control, ISA, 2006.
See Also
ControlDesign[ParameterIdentify][TimeDomain]
ControlDesign[ZNFreq]
ControlDesign[ZNTimeModified]
Download Help Document