Control Design Toolbox - MapleSim Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MapleSim Toolboxes : MapleSim Control Design Toolbox : MapleSimControlDesignToolbox/previousReleases/6.4/whatsNew

 

Control Design Toolbox

New Features of the MapleSim Control Design Toolbox 6.4

Numerous improvements and additions have been made to the MapleSim Control Design toolbox, including:

• 

New command for PID controller automatic tuning

• 

Updates to existing PID tuning commands to choose the format of the returned controller parameters

• 

Updates to existing control design commands to support the DynamicSystems parameters option, which is new in Maple 18

• 

New commands for the automatic computation of design parameters, such as poles and weighting matrices, for state feedback control design

• 

New commands for system manipulation (for example, determining the closed-loop equations of common feedback system configurations) and simplification (for example, eliminating the structurally non-minimal states of a system)

withControlDesign:  withDynamicSystems:

 

PID automatic tuning

PID tuning commands returned format

Support of parameters option

State Feedback design parameters

System manipulation and simplification

See Also

PID automatic tuning

The PIDAuto command performs automatic tuning of a PID controller based on a single tuning parameter, Tc, which has the same order of magnitude as the desired time constant of the closed-loop. The time constant is proportional to the settling time of the system (first order approximation) and, therefore, provides a simple way to specify the desired closed-loop system response. This command can obtain the PID controller parameters for a wide range of plants, including unstable systems. The best-suited tuning method is automatically selected according to both the order and stability of the input system.  For instance, for stable higher order systems (order greater than 2), Skogestad internal model control (SIMC) tuning rules are applied.

infolevelControlDesign  3:

Design a PID controller for a system of order 7 with desired time constant Tc = 0.77.

sys1TransferFunction10.3s1+0.08ss+12s+10.4s+10.2s+10.05s+13:

 

pid1  PIDAutosys1, 0.77

PIDAuto: Using Skogestad IMC tuning rules

pid1:=RecordpackedKp=2.077922078,Ki=0.6493506494,Kd=1.558441558,Tf=0.01558441558

(1.1)

Return a DynamicSystems  system object directly.

pidsys1  PIDAutosys1, 0.77, 'returntype' = system: PrintSystempidsys1;

PIDAuto: Using Skogestad IMC tuning rules

Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=u1soutputvariable=y1stf1,1=1.590824759s2+2.088041828s+0.64935064940.01558441558s2+s

(1.2)

Design a PID controller for an integrating process with desired time constant Tc = 1.0.

sys2  TransferFunction1s: 

pid2  PIDAutosys2, 1.0

PIDAuto: Using PIDUnstable

pid2:=RecordpackedKp=2.,Ki=1.,Kd=0.,Tf=0

(1.3)

Return a DynamicSystems  system object directly.

pidsys2  PIDAutosys2, 1.0, 'returntype' = system: PrintSystempidsys2;

PIDAuto: Using PIDUnstable

Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=u1soutputvariable=y1stf1,1=2.s+1s

(1.4)

PID tuning commands returned format

Existing PID tuning commands accept new options such as factored and returntype which are useful for specifying the way in which the controller parameters are returned. Use the option factored to return either the controller gains (proportional, integral, and derivative gain Kp, Ki, and Kd) or their factored version (proportional gain, integral time, and derivative time K, Ti, Td). Use the option returntype to return a record, a list or a system containing the controller parameters in either form or a DynamicSystems  system object . The updated commands are CohenCoon, DominantPole, GainPhaseMargin, ZNFreq, and ZNTimeModified.

 

sys3 NewSystems + 1/s^2 +  s + 1:

fotd3  evalfParameterIdentify:-TimeDomainsys3

fotd3:=1.,1.414213562,1.

(2.1)

By default, the CohenCoon command returns a list containing the PID controller gains Kp, Ki, and Kd.

pid_list  CohenCoonopfotd3, 'controller' = PID

pid_list:=2.152188309,1.079532192,0.7019962725

(2.2)

Using the new options factored and returntype, the CohenCoon command can return a record containing the factored version of the PID controller gains.

pid_rcrd  CohenCoonopfotd3, 'controller' = PID, 'factored' = true, 'returntype' = record

pid_rcrd:=RecordpackedK=2.152188309,Ti=1.993630504,Td=0.3261779044

(2.3)

By default, the DominantPole command returns a sequence of lists containing the controller gains ( Kp and Ki in this case) and the closed-loop poles.

pi_list  DominantPolesys3, 3+2I,32I, 'controller' = PI

pi_list:=478,918,78,32I,3+2I

(2.4)

Using the option returntype, the DominantPole command can return a DynamicSystems  system object directly.

pi_sys  DominantPolesys3, 3+2I,32I, 'controller' = PI, 'returntype' = system:PrintSystempi_sys

Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=u1soutputvariable=y1stf1,1=47s+918s

(2.5)

Support of parameters option

Existing ControlDesign commands that accept DynamicSystems system objects as input now accept the parameters option. You can use this option to define numeric values for symbolic parameters existing in the system object. This option is the same as the DynamicSystems parameters option.  For examples of its use see the sections below.

State Feedback design parameters

Two new commands ComputePoles and ComputeQR help with the calculation of the pole locations for Ackermann's formula and the Q and R weighting matrices for LQR design.

ComputePoles

The Ackermann command calculates the state feedback gain required in order to place the closed-loop poles in the desired locations. The ComputePoles automatically computes these pole locations such that the closed-loop system response has a desired time constant, Tc.  

sys4StateSpaceMatrix1,f,3,g,4,1,2,5,7,Matrix3,9,5,Matrix1,0,0,0,1,0,0,0,1,Matrix3,1:

PrintSystemsys4

State Spacecontinuous3 output(s); 1 input(s); 3 state(s)inputvariable=u1toutputvariable=y1t,y2t,y3tstatevariable=x1t,x2t,x3ta=1f3g4−1257b=395c=100010001d=000

(4.1.1)

params  f=2,g=0:

τ  0.1:

p  ComputePolessys4, τ, 'parameters' = params

p:=1.124260354+3.158898890I,1.1242603543.158898890I,10.

(4.1.2)

KcStateFeedback:-Ackermannsys4,p,  'parameters' =params

Kc:=3.5228392390.60911312541.639596973

(4.1.3)

ComputeQR

The LQR command calculates the linear quadratic state feedback regulator (LQR) gain given the weighting matrices Q and R. The ComputeQR command automatically computes these weighting matrices Q and R to obtain a closed-loop system with desired time constant, Tc.  

QRmat ComputeQRsys4, τ, 'parameters' = params

QRmat:=RecordQ=1.0.0.0.1.0.0.0.1.,R=2.83828026835937

(4.2.1)

KcLQRsys4,QRmat:-Q,QRmat:-R,  'parameters'=params

Kc:=1.723239353950800.7129870140764953.18235779686362

(4.2.2)

System manipulation and simplification

The new commands for system manipulation and simplification are ControllerObserver, PIDClosedLoop, StateFeedbackClosedLoop, and ReduceSystem.

ControllerObserver

The ControllerObserver command calculates the equations of the subsystem comprised of a state feedback controller and an observer. This command is useful, for example, to construct an LQG controller comprised of an LQR state feedback controller and a Kalman observer. Use the closedloop option to obtain the closed-loop equations of the system with state feedback and observer.

sys5StateSpaceMatrix0,1,0,0,Matrixα,1,Matrix1,0,Matrix1,1:

PrintSystemsys5

State Spacecontinuous1 output(s); 1 input(s); 2 state(s)inputvariable=u1toutputvariable=y1tstatevariable=x1t,x2ta=0100b=α1c=10d=0

(5.1.1)

Define the numeric value for parameter α

param   α=2:

Design the LQR controller

W  ComputeQRsys5, 0.5, 'parameters' = param

W:=RecordQ=1.0.0.0.,R=1.27083333333333

(5.1.2)

Kc5,Kr5LQRsys5,W:-Q,W:-R, 'parameters' =param, 'return_Kr' = true

Kc5,Kr5:=0.8870655251454870.444353124522434,0.887065525145487

(5.1.3)

Design the Kalman observer

G1LinearAlgebra:-IdentityMatrixsys5:-statecount:

Q123 LinearAlgebra:-IdentityMatrixsys5:-statecount:

H1Matrix1,0:

R1Matrix2:

KobsKalmansys5,G1,H1,Q1,R1, 'parameters'=param1

Kobs:=1.368033988749890.500000000000000

(5.1.4)

Obtain the LQG controller.

LQG:=ControllerObserversys5,Kc5,Kobs, 'Kr'=Kr5, 'parameters'=param:

PrintSystemLQG

State Spacecontinuous1 output(s); 2 input(s); 2 state(s)inputvariable=y1_reft,y1_meastoutputvariable=u1tstatevariable=x1_estt,x2_estta=3.14216503904086950.11129375095513151.38706552514548730.44435312452243425b=1.77413105029097481.3680339887498950.88706552514548740.5c=0.88706552514548740.44435312452243425d=0.8870655251454874210

(5.1.5)

Obtain the LQG control system closed-loop equations.

clLQGControllerObserversys5,Kc5,Kobs, 'Kr'=Kr5, 'parameters'=param, 'closedloop'=true:

PrintSystemclLQG

State Spacecontinuous1 output(s); 1 input(s); 4 state(s)inputvariable=y1_reftoutputvariable=y1tstatevariable=x1t,x2t,x1_estt,x2_estta=01−1.77413105029097484−0.88870624904486850100−0.887065525145487421−0.4443531245224342511.368033988749894900.−3.142165039040869520.1112937509551314990.5000000000000000000.−1.38706552514548731−0.444353124522434251b=1.774131050290974840.8870655251454874211.774131050290974840.887065525145487421c=1.00.00.00.0d=0.0

(5.1.6)

PIDClosedLoop

The PIDClosedLoop command calculates the closed-loop system equations of a feedback system with the controller Gc located in the forward path before the plant Gp and inside the feedback loop. The feedback system has unity negative feedback. This is a basic feedback structure commonly used for P/PI/PID control, hence the name of the command.

Gp  TransferFunctionω2As2+2ωθs+ω2:

Gc  TransferFunctionkp+ki/s:

cl  PIDClosedLoopGp, Gc: 

PrintSystemcl

Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=y1_refsoutputvariable=y1stf1,1=ω2Akps+ω2Akis3+2ωθs2+ω2Akp+ω2s+ω2Aki

(5.2.1)

clnum  PIDClosedLoopGp, TransferFunction0.5+0.1/s, 'parameters' = A=1, ω=1.2, θ=2: 

PrintSystemclnum

Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=y1_refsoutputvariable=y1stf1,1=0.7200000000s+0.1440000000s3+4.800000000s2+2.160000000s+0.1440000000

(5.2.2)

 

Use the PIDClosedLoop command to access the controller output node through the augment_output option.

claug  PIDClosedLoopGp, Gc, 'augment_output' = true: 

PrintSystemclaug

Transfer Functioncontinuous2 output(s); 1 input(s)inputvariable=y1_refsoutputvariable=y1s,u1stf1,1=ω2Akps+ω2Akis3+2ωθs2+ω2Akp+ω2s+ω2Akitf2,1=kps3+2kpωθ+kis2+2kiωθ+kpω2s+ω2kis3+2ωθs2+ω2Akp+ω2s+ω2Aki

(5.2.3)

StateFeedbackClosedLoop

The StateFeedbackClosedLoop command calculates the closed-loop system equations of a plant with state feedback. This command requires the state feedback gain matrix Kc, but can also accept the feed-forward matrix Kr to support a state feedback structure with control law  uc=Kc.x+Kr.r.

Kc, KrStateFeedback:-Ackermannsys4,p,  'parameters' =params, 'return_Kr' = true

Kc,Kr:=3.5228392390.60911312541.639596973,2.547518990206080.5363197874118070.871519654544186

(5.3.1)

clsf  StateFeedbackClosedLoopsys4, Kc, ':-Kr' = Kr, ':-parameters' = params:

PrintSystemclsf

State Spacecontinuous3 output(s); 3 input(s); 3 state(s)inputvariable=y1_reft,y2_reft,y3_reftoutputvariable=y1t,y2t,y3tstatevariable=x1t,x2t,x3ta=9.5685177170.172660623800000131.91879091931.7055531511.482018128615.75637275715.6141961950000021.95443437300000021.1979848650000005b=7.6425569706182461.60895936223542082.61455896363255822.927670911854744.8268780867062627.84367689089767412.7375949510304112.6815989370590354.35759827272093c=1.00.00.00.01.00.00.00.01.0d=0.00.00.00.00.00.00.00.00.0

(5.3.2)

ReduceSystem

The ReduceSystem command simplifies a state-space system by detecting and removing its structural unobservable and uncontrollable states. These struturally non-minimal states may occur, for example, as a result of extracting a subsystem from a subset of its inputs and/or outputs. The reduced state-space system is structurally minimal, that is, contains a subset of the original system states but preserves its state structure and variable names. The input/output response of the reduced system is equivalent to the transfer function of the original system.

sys6StateSpaceMatrixδ,0,φ,σ,3,0,0,3,1,0,1,1,0,0,0,0, Matrix5, z,1,1,3,x,0,2,y, 0,0,z, Matrix1,0,3,5, 3,0,σ,7, Matrix1,0,0,0,1,1:

PrintSystemsys6

State Spacecontinuous2 output(s); 3 input(s); 4 state(s)inputvariable=u1t,u2t,u3toutputvariable=y1t,y2tstatevariable=x1t,x2t,x3t,x4ta=δ0φσ300310−110000b=5z−113x02y00zc=1035−30σ7d=100011

(5.4.1)

Get a subsystem with inputs u1(t) and u2(t). This subsystem is uncontrollable and unobservable.

subsys6  Subsystemsys6, 1,2: Controllablesubsys6, Observablesubsys6

false,false

(5.4.2)

Get a structurally minimal system removing the non-minimal (structural uncontrollable and unobservable) states.

redsys ReduceSystemsubsys6:Controllableredsys, Observableredsys

true,true

(5.4.3)

PrintSystemredsys

State Spacecontinuous2 output(s); 2 input(s); 2 state(s)inputvariable=u1t,u2toutputvariable=y1t,y2tstatevariable=x1t,x3ta=δφ1−1b=5z02c=13−3σd=1001

(5.4.4)

Verify the input/output response is not affected by the removed states.

verifyTransferFunctionsubsys6:-tf, TransferFunctionredsys:-tf, 'Matrix'

true

(5.4.5)

See Also

ControlDesign, DynamicSystems


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