design linear quadratic state feedback regulator (LQR) for a given state-space system - 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

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

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:

csys:=NewSystemMatrix2s2+3s+1,1s+2,s1s2+5,7s+1s+4:

csys:-tf

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

(1)

sys:=StateSpacecsys:

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

010000000100000001000515630000000010000000100008147

00000010000001

1002045112211470

0000

(2)

Q:=1LinearAlgebra:-IdentityMatrix73;R:=2LinearAlgebra:-IdentityMatrix2

Q:=13000000013000000013000000013000000013000000013000000013

R:=2002

(3)

K:=LQRsys,Q,R

K:=0.01663898109747050.2994436759550440.8677764521914780.3018509310763290.0.0.0.0.0.0.0.01040989379861050.01954395072894290.0146813589873455

(4)

Kpr:=LQRsys,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:

dsys:=ToDiscretecsys,1,'method'=bilinear

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

(6)

sys:=StateSpacedsys

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)

K:=LQRsys,Q,R

K:=0.04812023136563610.3016034841234630.4208348950165690.05115143025951990.0.0.0.0.0.0.0.0.03724081407012741.6957458239175510-50

(8)

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

0.04812023136563610.3016034841234630.4208348950165690.05115143025951990.0.0.0.0.0.0.0.0.03724081407012741.6957458239175510-50

0.0959924471141893+0.725780367537388I0.09599244711418930.725780367537388I0.597646681622232+0.I0.133580894353374+0.I0.+0.I0.271790906819696+0.I0.271790906819696+0.I

0.342082466311878242371531572864956503609278376051700.0548369971320015874453322979671680126791009534428520.0765154354835731722076993713204211295435088438590460.00930026005034752459581011853863548971243280755447190.0.0.0.0548369971320015874453322979671680126791009534428521.01907954391333324478867282779146001227052426435760.424672649233236577232128032563762331172893999589420.0161167277015403230959726324754276462041553947111510.0.0.0.0765154354835731722076993713204211295435088438590460.424672649233236577232128032563762331172893999589422.02146219736302309604530790205228839403533562030630.509659956602684599352910119056372560318246175029490.0.0.0.00930026005034752459581011853863548971243280755447190.0161167277015403230959726324754276462041553947111510.509659956602684599352910119056372560318246175029492.24919438584273073925621631927013280105734502167420.0.0.0.0.0.0.0.333333333333333333333333333333333333333333333333332.427009469103400288034419882770445884213990576029910-511.000794776960814411211494124573928190219249320763310-500.0.0.0.2.427009469103400288034419882770445884213990576029910-510.674942403125867398096137593981206415196581814763515.101271017293181184787359721434823824276933993430210-500.0.0.0.1.000794776960814411211494124573928190219249320763310-505.101271017293181184787359721434823824276933993430210-501.0082757364592007314294709273145397485299151480967

0.4741040743284520.1354583069244270.05788310643429440.578831064342944

(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