ControlDesign - MapleSim Help

Online Help

All Products    Maple    MapleSim


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

ControlDesign

  

LQR

  

design linear quadratic state feedback regulator (LQR) for a given state-space system

 

Calling Sequence

Parameters

Options

Solvability Conditions

Description

Examples

Calling Sequence

LQR(sys, Q, R, opts)

Parameters

sys

-

System; system object

Q

-

Matrix; state weighting matrix

R

-

Matrix; input weighting matrix

opts

-

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

Options

• 

N = Matrix or Vector

  

Weighting on the state-input multiplication term in the cost function. If omitted, a zero matrix with appropriate dimensions will be considered.

• 

poles = true or false

  

True means the eigenvalues of A-BK are returned. The default value is false.    

• 

riccati = true or false

  

True means the solution of the associated Riccati equation is returned.

For a continuous system, the infinite horizon solution of the following continuous-time Riccati equation (CARE) is returned.

ATX+XAXB+NR1XB+NT+Q=0

The LQR feedback gain is calculated as

K=R1XB+NT

For a discrete system, the infinite horizon solution of the following discrete-time Riccati equation (DARE) is returned

ATXAXATXB+NBTXB+R1BTXA+NT+Q=0

The LQR feedback gain is calculated as

K=BTXB+R1BTXA+NT

The default value is false.

• 

return_Kr = true or false

  

True means the direct gain Kr is returned. The default value 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).

Solvability Conditions

• 

The pair A,B must be stabilizable.

• 

The pair QNR1NT,ABR1NT must have no unobservable modes on the imaginary axis in continuous-time domain or on the unit circle in discrete-time domain.

• 

R>0 (positive definite) and QNR1NT0 (positive semidefinite).

Description

• 

The LQR command calculates the LQR state feedback gain for a 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).

• 

In continuous time, the optimal state feedback gain, K, is calculated such that the quadratic cost function

Ju=0xTQx+uTRu+2xTΝuⅆt

is minimized by the feedback law u = -Kx subject to the system dynamics

x·=Ax+Bu

• 

In discrete time, the optimal state feedback gain, K, is calculated such that the quadratic cost function

Ju=n=0xTQx+uTRu+2xTΝu

is minimized by the feedback law u[n] = -Kx[n] subject to the system dynamics

xn+1=Axn+Bun

• 

Q and R are expected to be symmetric. If the input Q and/or R are not symmetric, their symmetric part will be considered since their antisymmetric (skew-symmetric) part has no role in the quadratic cost function.

• 

In addition to the state feedback gain, depending on the corresponding option values, the command also returns the closed-loop eigenvalues and the solution of the associated Riccati equation.

• 

The direct gain Kr is computed as follows:

CD.K.1A+B.K.B+D (continuous time)

CD.K.1A+I+B.K.B+D (discrete time)

• 

If sys contains structured uncontrollable states, they are removed before computing the LQR state feedback. The resulting gain K is then filled with zeros at positions corresponding to the removed states; however, the other outputs are not filled and, consequently, they may have lower dimensions as expected.

Examples

withControlDesign:

withDynamicSystems:

csysNewSystemMatrix2s2+3s+1,1s+2,s1s2+5,7s+1s+4:

csys:-tf

2s2+3s+11s+2s1s2+57s2+5s+4

(1)

sysStateSpacecsys:

sys:-a;sys:-b;sys:-c;sys:-d

010000000100000001000515630000000010000000100008147

00000010000001

1002045112211470

0000

(2)

Q1LinearAlgebra:-IdentityMatrix73;R2LinearAlgebra:-IdentityMatrix2

Q:=13000000013000000013000000013000000013000000013000000013

R:=2002

(3)

KLQRsys,Q,R

K:=0.01663898109747050.2994436759550440.8677764521914780.3018509310763290.0.0.0.0.0.0.0.01040989379861050.01954395072894290.0146813589873455

(4)

KprLQRsys,Q,R,'poles'=true,'riccati'=true,'return_Kr'=true:Kpr1;Kpr2;Kpr3;Kpr4

0.01663898109747050.2994436759550440.8677764521914780.3018509310763290.0.0.0.0.0.0.0.01040989379861050.01954395072894290.0146813589873455

2.62756665299744+0.I0.145624709217511+2.22784297750641I0.1456247092175112.22784297750641I0.383034859643869+0.I1.00185981437603+0.I1.98515367555330+0.I4.02766786905801+0.I

3.50357106780249636427356983347380869701730928710788.90631012705411115311675810756718031049477924614583.12838818122098082686058820294514592760627824361050.0332779621949409374206603236526689213529915396260090.0.0.8.906310127054111153116758107567180310494779246145827.01792983748675985061180093742507824269810008618110.9996867306090944849060693759024372654302363650350.598887351910087243343592782953780547783773573792700.0.0.3.128388181220980826860588202945145927606278243610510.9996867306090944849060693759024372654302363650358.75386079427495244526889789195148694929582021351381.73555290438295551200857175359974385723535498487790.0.0.0.0332779621949409374206603236526689213529915396260090.598887351910087243343592782953780547783773573792701.73555290438295551200857175359974385723535498487790.603701862152658441644654693320879940510941682759390.0.0.0.0.0.0.0.604587138927168509676898420793792313225217218130870.380945919753830599663964618798960532181765706634190.0208197875972210396136451371378709701895903592627870.0.0.0.0.380945919753830599663964618798960532181765706634190.664447437767019541498152361507087810149285907951570.0390879014578858512583266659427122986389872752131640.0.0.0.0.0208197875972210396136451371378709701895903592627870.0390879014578858512583266659427122986389872752131640.029362717974691029572229097828269653238134822396934

0.4877287898289210.1393510828082630.05562784648471260.556278464847126

(5)

We can also use LQR with discrete models:

dsysToDiscretecsys,1,'method'=bilinear

dsys:=Transfer Functiondiscrete; sampletime = 12 output(s); 2 input(s)inputvariable=u1z,u2zoutputvariable=y1z,y2z

(6)

sysStateSpacedsys

sys:=State Spacediscrete; sampletime = 12 output(s); 2 input(s); 7 state(s)inputvariable=u1q,u2qoutputvariable=y1q,y2qstatevariable=x1q,x2q,x3q,x4q,x5q,x6q,x7q

(7)

KLQRsys,Q,R

K:=0.04812023135991430.3016034842872720.4208348953450350.05115143016560900.0.0.0.0.0.0.0.0.03724081407012749.7606656366257010-51

(8)

KprLQRsys,Q,R,'poles'=true,'riccati'=true,'return_Kr'=true:Kpr1;Kpr2;Kpr3;Kpr4

0.04812023135991430.3016034842872720.4208348953450350.05115143016560900.0.0.0.0.0.0.0.0.03724081407012749.7606656366257010-51

0.0959924471365447+0.725780367567049I0.09599244713654470.725780367567049I0.597646681582207+0.I0.133580894274726+0.I0.+0.I0.271790906819696+0.I0.271790906819696+0.I

0.342082466307950697771416932718558156273138383885160.0548369971436887924082479583030618790456385161734910.0765154355180443195172182993354600571032994387984010.00930026003020372286930278584139618378658879868347600.0.0.0.0548369971436887924082479583030618790456385161734911.01907954421038370125310413738252454741176564295320.424672649754753825907090735321819139291369094576230.0161167278273309432267789914450936841209498377188470.0.0.0.0765154355180443195172182993354600571032994387984010.424672649754753825907090735321819139291369094576232.02146219856164920092894909770820871820864681716160.509659957051269219426006118369376537440933325477320.0.0.0.00930026003020372286930278584139618378658879868347600.0161167278273309432267789914450936841209498377188470.509659957051269219426006118369376537440933325477322.24919438685146851376566202589753941507655526953060.0.0.0.0.0.0.0.333333333333333333333333333333333333333333333333333.849682204075197313832138911272964585782323893134910-506.134085753565080457514129722636739903718221004445210-510.0.0.0.3.849682204075197313832138911272964585782323893134910-500.674942403125867397047673519465297544722655105270722.936277360635219293240741378883996981274593063048210-500.0.0.0.6.134085753565080457514129722636739903718221004445210-512.936277360635219293240741378883996981274593063048210-501.0082757364592007303810068527986308780559884386041

0.4741040743104210.1354583069456280.05788310645187300.578831064350061

(9)

See Also

ControlDesign

ControlDesign[LQRContinuous]

ControlDesign[LQRDiscrete]

ControlDesign[LQROutput]

ControlDesign[StateFeedback][Ackermann]

ControlDesign[StateFeedback][PolePlacement]

 


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