compute the Q, R, and N matrices used in an LQR design based on a desired time constant of the closed-loop system - MapleSim Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MapleSim Toolboxes : MapleSim Control Design Toolbox : ControlDesign Package : State Feedback : ControlDesign/ComputeQR

ControlDesign[ComputeQR] - compute the Q, R, and N matrices used in an LQR design based on a desired time constant of the closed-loop system

Calling Sequence

ComputeQR(sys, Tc, opts)

Parameters

sys

-

System; system object

Tc

-

And(positive, numeric); desired closed-loop time constant (in seconds)

opts

-

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

Description

• 

The ComputeQR command returns a record containing the Q and R weighting matrices needed by the LQR command. Optionally, the cross-coupling matrix N (weighting on the state-input term in the quadratic cost function) is included in the returned record to be used with the corresponding option of the LQR command.

• 

The computation of the weighting matrices is based on the desired time constant, Tc (seconds), of the closed-loop system.

• 

The system sys is a continuous or discrete-time linear system object created using the DynamicSystems package. The system object must be in state-space (SS) form. The state-space system can be either single-input/single-output (SISO) or multiple-input/multiple-output (MIMO).

• 

The ComputeQR command invokes the ReduceSystem command to remove the structural uncontrollable states of sys which may arise from using the Subsystem command before ComputeQR. The computed weighting matrices are obtained based in the reduced system (when applicable).

Examples

withControlDesign:

withDynamicSystems:

Here is a state-space system corresponding to a DC motor model:

sys_aMatrixdJ,KJ,0,KL,RL,0,1,0,0:

sys_bMatrix0,1J,1L,0,0,0:

sys_cMatrix0,1,0,1,0,0,0,0,1:

sys_dMatrix0,0,0,0,0,0:

sysStateSpacesys_a,sys_b,sys_c,sys_d,inputvariable=Vt,Tt,outputvariable=i_outt,omega_outt,theta_outt,statevariable=ωt,it,θt:

PrintSystemsys

State Spacecontinuous3 output(s); 2 input(s); 3 state(s)inputvariable=Vt,Ttoutputvariable=i_outt,omega_outt,theta_outtstatevariable=ωt,it,θta=dJKJ0KLRL0100b=01J1L000c=010100001d=000000

(1)

The numeric values of the model parameters are as follows:

paramsJ=0.01,d=0.1,K=0.01,R=1,L=0.5:

Extract a subsystem with the desired input and output.

subsysSubsystemsys,1,2

subsys:=State Spacecontinuous1 output(s); 1 input(s); 3 state(s)inputvariable=Vtoutputvariable=omega_outtstatevariable=ωt,it,θt

(2)

Compute the weighting Matrices Q and R for a desired time constant of 1 second:

τ1:

QRComputeQRsubsys,τ,'parameters'=params

QR:=RecordQ=1.0.0.0.0.0.0.0.0.,R=0.00804031799261398

(3)

Use the previous result to compute the state feedback gain:

KcLQRsubsys,QR:-Q,QR:-R,'parameters'=params

Kc:=0.9634507842906180.4012318809856620

(4)

Optionally, compute the weighting Matrix N:

QRNComputeQRsubsys,τ,'computeN'=true,'parameters'=params

QRN:=RecordQ=1.0.0.0.0.0.0.0.0.,R=0.00804031799261398,N=0.0.0.

(5)

Use matrices Q, R, and N to compute the state feedback gain. In this case, N is a zero Matrix, so the result is the same as before:

KcLQRsubsys,QRN:-Q,QRN:-R,'N'=QRN:-N,'parameters'=params

Kc:=0.9634507842906180.4012318809856620

(6)

See Also

ControlDesign, ControlDesign[LQR], ControlDesign[LQRContinuous], ControlDesign[LQRDiscrete]


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