ComputeQR - MapleSim Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

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

Parameters

Options

Description

Examples

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

Options

• 

computeN = truefalse

  

True means include the  weighting matrix in the returned record. The default is false.

• 

parameters = {list, set}(name = complexcons)

  

Specifies numeric values for the parameters of sys. These values override any parameters previously specified for sys. The numeric value on the right-hand side of each equation is substituted for the name on the left-hand side in the sys equations. The default is the value of sys given by DynamicSystems:-SystemOptions(parameters).

Description

• 

The ComputeQR command returns a record containing the  and  weighting matrices needed by the LQR command. Optionally, the cross-coupling matrix  (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

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

(1)

The numeric values of the model parameters are as follows:

Extract a subsystem with the desired input and output.

(2)

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

(3)

Use the previous result to compute the state feedback gain:

(4)

Optionally, compute the weighting Matrix N:

(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:

(6)

See Also

ControlDesign

ControlDesign[LQR]

ControlDesign[LQRContinuous]

ControlDesign[LQRDiscrete]

 


Download Help Document