determine the closed-loop equations of a system with PID controller - MapleSim Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MapleSim Toolboxes : MapleSim Control Design Toolbox : ControlDesign Package : System Manipulation : ControlDesign/PIDClosedLoop

ControlDesign[PIDClosedLoop] - determine the closed-loop equations of a system with PID controller

Calling Sequence

PIDClosedLoop(sys, pid, opts)

Parameters

sys

-

System; system object

pid

-

System; controller system object

opts

-

(optional) equation(s) of the form option = value; specify options for the PIDClosedLoop command

Description

• 

The PIDClosedLoop command calculates the closed-loop system equations of a system sys with a PID controller pid in the direct path.

• 

The system sys is a SISO (single input, single output) or MIMO (multiple input, multiple output) linear system object created using the DynamicSystems package. The system object can be of types: transfer function (TF), zero-pole-gain (ZPK), coefficients (Coeff), state-space (SS), and diff-equation (DE).

• 

The controller pid is a SISO (single input, single output) system object created using the DynamicSystems package. The system object is generally a transfer function (TF).

• 

If sys is a MIMO system, only one input and one output can be selected to form the closed-loop system with the PID controller pid.

– 

If uc is the ith input of sys, y_ref is the ith  input of the closed-loop.

– 

If yc is the jth output of sys, it remains the jth  output of the closed-loop.  

  

The rest of the inputs unc (non-controlled inputs) and outputs ync (non-controlled outputs) of sys are also included in the inputs and outputs of the closed-loop system.

• 

The pid output (uc) is appended to the output vector of the closed-loop if the option augment_output = true is specified.

• 

The PIDClosedLoop command returns a system object whose type is the same as the type of sys, unless the option outputtype is specified.

Examples

withDynamicSystems:

withControlDesign:

Differential equations of a DC motor model:

eq1:=Jⅆⅆtωt+bωtKit=0:

eq2:=Lⅆⅆtit+Rit=VtKωt:

eq3:=ⅆⅆtθt=ωt:

The numeric values of the model parameters are as follows:

params:=J=0.01,K=0.01,L=0.5,R=1,b=0.1:

Transfer function

systf:=TransferFunctioneq1,eq2,eq3,Vt,it,ωt,θt:

PrintSystemsystf

Transfer Functioncontinuous3 output(s); 1 input(s)inputvariable=Vsoutputvariable=is,ωs,θstf1,1=Js+bJLs2+JR+Lbs+K2+Rbtf2,1=KJLs2+JR+Lbs+K2+Rbtf3,1=KJLs3+JR+Lbs2+K2+Rbs

(1)

Extract a subsystem with the desired output (position θ):

subsystf:=Subsystemsystf,'all',3:

PrintSystemsubsystf

Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=Vsoutputvariable=θstf1,1=KJLs3+JR+Lbs2+K2+Rbs

(2)

Design a position controller with a settling time of 2 seconds (time constant is about 0.7 s):

τ:=0.7

τ:=0.7

(3)

PIDgains:=PIDAutosubsystf,τ,'parameters'=params

PIDgains:=RecordpackedKp=10.2115133154945,Ki=0.000879895477927287,Kd=1.01771326328058,Tf=0

(4)

The controller system is designed according to the following expression:

Kc:=PIDgains'Kp'+PIDgains'Ki's+PIDgains'Kd's1+1PIDgains'Kd's100

Kc:=10.2115133154945+0.000879895477927287s+1.01771326328058s1+0.0101771326328058s

(5)

sysKc:=TransferFunctionKc:

PrintSystemsysKc

Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=u1soutputvariable=y1stf1,1=1.121637189s2+10.21152227s+0.00087989547790.01017713263s2+s

(6)

Calculate the feedback system with the original system to observe all the closed-loop system transfer functions. The controller output Vs is also included using the augment_output option.

feedback:=PIDClosedLoopsystf,sysKc,'parameters'=params,'controlled_output'=3,'augment_output'=true:

PrintSystemfeedback

Transfer Functioncontinuous4 output(s); 1 input(s)inputvariable=theta_refsoutputvariable=is,ωs,θs,Vstf1,1=5.70752521810−7s7+0.00007383461575s6+0.001938610656s5+0.01992714700s4+0.08375976566s3+0.1022235877s2+8.80775373410−6s2.58935071410−9s8+5.71001048610−7s7+0.00003768910326s6+0.0006954648583s5+0.004914660338s4+0.01347328969s3+0.01737375949s2+0.01022227069s+8.80775373410−7tf2,1=5.70752521810−7s6+0.00006812709054s5+0.001257339750s4+0.007353749497s3+0.01022227069s2+8.80775373410−7s2.58935071410−9s8+5.71001048610−7s7+0.00003768910326s6+0.0006954648583s5+0.004914660338s4+0.01347328969s3+0.01737375949s2+0.01022227069s+8.80775373410−7tf3,1=0.01121637189s2+0.1021152227s+8.79895477910−60.00005088566315s5+0.005610627958s4+0.06101873098s3+0.1113163719s2+0.1021152227s+8.79895477910−6tf4,1=0.005608185945s5+0.1183558427s4+0.7249716183s3+1.022226173s2+0.00008807753734s0.00005088566315s5+0.005610627958s4+0.06101873098s3+0.1113163719s2+0.1021152227s+8.79895477910−6

(7)

Plot the step response for the position output, θ:

ResponsePlotfeedback,1,'duration'=10,'gridlines'=true,'parameters'=params,'output'=θ

See Also

ControlDesign, ControlDesign[PIDAuto]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam