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.



pid1  PIDAutosys1, 0.77

PIDAuto: Using Skogestad IMC tuning rules



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


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

sys2  TransferFunction1s: 

pid2  PIDAutosys2, 1.0

PIDAuto: Using PIDUnstable



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


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



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

pid_list  CohenCoonopfotd3, 'controller' = PID



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



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



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


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.


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.  



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


params  f=2,g=0:

τ  0.1:

p  ComputePolessys4, τ, 'parameters' = params



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




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



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



System manipulation and simplification

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


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.



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


Define the numeric value for parameter α

param   α=2:

Design the LQR controller

W  ComputeQRsys5, 0.5, 'parameters' = param



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



Design the Kalman observer


Q123 LinearAlgebra:-IdentityMatrixsys5:-statecount:



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



Obtain the LQG controller.

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


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


Obtain the LQG control system closed-loop equations.

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


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=



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: 


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


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


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



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

claug  PIDClosedLoopGp, Gc, 'augment_output' = true: 


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



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



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


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=



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:


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


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

subsys6  Subsystemsys6, 1,2: Controllablesubsys6, Observablesubsys6



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

redsys ReduceSystemsubsys6:Controllableredsys, Observableredsys




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


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

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



See Also

ControlDesign, DynamicSystems