Hello all,

This is my first post on the group. I'm hoping that the group can help me b etter understand something.

I'm designing a feedback controller with LQR in Matlab. My LTI model (A,B,C
,D) is very stiff and the LQR numerics struggle with it (complaining about
an ill-conditioned system). So, I chose to balance the system using Matlab'
s BALREAL. This resolved the numerical challenge (atleast LQR stopped compl
aining).

BALREAL returns the similarity transformation matrices to convert between t he original state vector 'x' and the newly balanced state vector 'x_b'. Tha t relation is,

x_b = T***x, and
x = Ti***x_b

LQR produces an optimal state-feedback gain matrix that minimizes,

J = Integral {x'***Q***x + u'***R***u + 2***x'***N*u} dt

or, if used with the new system it would be,

J = Integral {x_b'***Q_b***x_b + u'***R***u + 2***x_b'***N*u} dt

(NOTE: I'm not specifying an N matrix...)

where 'u' are the inputs into the system.

Now to my question. The state-space for the original LTI system has physica l meaning, where the state-space for the newly balanced system does not. Wh en designing my controllers with LQR I know how to construct my Q & R matri ces because of the physical meaning in the state vector 'x'. However, I los e that intuition when trying to apply LQR to the new balanced system. Meani ng, what is the relationship between Q_b and Q?

If we subsitute the definition of 'x_b' into the cost function for the orig inal system we get,

J = Integral {x_b'***Ti'***Q***Ti***x_b + u'***R***u + 2***x'***N*u} dt

To me this means that,

Q_b = Ti'***Q***Ti

Now for the problem... let's assume that I have a fully actuated 2 degree-o f-freedom mass-spring-damper with a state vector of,

x = [z1; z2; zdot1; zdot2]

where z1 and z2 are the positions of the masses and zdot1 and zdot2 are the ir respective rates.

My experience with an LQR based controller design process has been that if I want to control z1 more than z2 and I don't really care about zdot1 and z dot 2 then a good set of Q & R matrices would be,

Q = [a 0 0 0 0 b 0 0 0 0 0 0 0 0 0 0] R = [1 0 0 1]

chosing the ratio between 'a' and 'b' in defining 'Q' determines how well z 1 performs relative to z2. Meaning, if I make 'a' a lot bigger than 'b' the n the feedback control law from LQR will allocate more control authority to z1 and assuming the dynamices between the two DOFs are similar then then r esponse time of z1 will be superior to z2. Correct?

I can construct my Q matrix this way because of the physical intuition of t he state-space. I know what states the diagonal elements of Q correspond to and I can penalize them accordingly...

However, I have no intuition to the balanced state-space. I assumed that by using,

Q_b = Ti'***Q***Ti

I would define Q as before leveraging the physical intuition and then trans form the penalty matrix appropriately to the balanced state-space and that the resulting performance would have a similar affect... Unfortunately, it didn't seem to behave that way...

Meaning, for our 2DOF example, if my original output relationship was,

[y1; y2] = [1 0 0 0; 0 1 0 0] * [z1; z2; zdot1; zdot2]

and the corresponding balanced output,

[y1; y2] = [1 0 0 0; 0 1 0 0]*** Ti *** [z1_b; z2_b; zdot1_b; zdot2_b]

then by I assumed that by using the relationship,

Q_b = Ti'***Q***Ti

that I would be able to control the performance of the y1 output relative t o y2 through the newly balanced LTI system when computing the feedback law with LQR. However, the resulting performance did not seem to map to the ori ginal state-space as I am trying to do.

I hope this question makes sense. If is does... is my assumption/expectatio n wrong? Or, is the Q_b relation not appropriate to use for some reason?

I'm all ears. Thanks.

This is my first post on the group. I'm hoping that the group can help me b etter understand something.

BALREAL returns the similarity transformation matrices to convert between t he original state vector 'x' and the newly balanced state vector 'x_b'. Tha t relation is,

x_b = T

LQR produces an optimal state-feedback gain matrix that minimizes,

J = Integral {x'

or, if used with the new system it would be,

J = Integral {x_b'

(NOTE: I'm not specifying an N matrix...)

where 'u' are the inputs into the system.

Now to my question. The state-space for the original LTI system has physica l meaning, where the state-space for the newly balanced system does not. Wh en designing my controllers with LQR I know how to construct my Q & R matri ces because of the physical meaning in the state vector 'x'. However, I los e that intuition when trying to apply LQR to the new balanced system. Meani ng, what is the relationship between Q_b and Q?

If we subsitute the definition of 'x_b' into the cost function for the orig inal system we get,

J = Integral {x_b'

To me this means that,

Q_b = Ti'

Now for the problem... let's assume that I have a fully actuated 2 degree-o f-freedom mass-spring-damper with a state vector of,

x = [z1; z2; zdot1; zdot2]

where z1 and z2 are the positions of the masses and zdot1 and zdot2 are the ir respective rates.

My experience with an LQR based controller design process has been that if I want to control z1 more than z2 and I don't really care about zdot1 and z dot 2 then a good set of Q & R matrices would be,

Q = [a 0 0 0 0 b 0 0 0 0 0 0 0 0 0 0] R = [1 0 0 1]

chosing the ratio between 'a' and 'b' in defining 'Q' determines how well z 1 performs relative to z2. Meaning, if I make 'a' a lot bigger than 'b' the n the feedback control law from LQR will allocate more control authority to z1 and assuming the dynamices between the two DOFs are similar then then r esponse time of z1 will be superior to z2. Correct?

I can construct my Q matrix this way because of the physical intuition of t he state-space. I know what states the diagonal elements of Q correspond to and I can penalize them accordingly...

However, I have no intuition to the balanced state-space. I assumed that by using,

Q_b = Ti'

I would define Q as before leveraging the physical intuition and then trans form the penalty matrix appropriately to the balanced state-space and that the resulting performance would have a similar affect... Unfortunately, it didn't seem to behave that way...

Meaning, for our 2DOF example, if my original output relationship was,

[y1; y2] = [1 0 0 0; 0 1 0 0] * [z1; z2; zdot1; zdot2]

and the corresponding balanced output,

[y1; y2] = [1 0 0 0; 0 1 0 0]

then by I assumed that by using the relationship,

Q_b = Ti'

that I would be able to control the performance of the y1 output relative t o y2 through the newly balanced LTI system when computing the feedback law with LQR. However, the resulting performance did not seem to map to the ori ginal state-space as I am trying to do.

I hope this question makes sense. If is does... is my assumption/expectatio n wrong? Or, is the Q_b relation not appropriate to use for some reason?

I'm all ears. Thanks.

Unfortunately, I think that this group has petered down to spammers, lurkers, and me. But I'll do what I can -- there's much more activity on https://www.reddit.com/r/controltheory .

... and, unfortunately, I'm not an expert in that design method (and I'm rather cynical about Matlab, but that's me). So, reddit, unless some lurker speaks up with something useful.

I

--

Tim Wescott

Wescott Design Services

Tim Wescott

Wescott Design Services

Click to see the full signature.

if you can map from one Q to the other Q_b then I don't see an issue.
Q should be full rank though so your example should have at least a small weighting for the other states (a and b >> c and d).
Q = [a 0 0 0
0 b 0 0
0 0 c 0
0 0 0 d]
R = [1 0
0 1]

### Peter Ponders PID YouTube Channel

- - next thread in ⧑ Industrial Control Group

### Peter Ponders PID YouTube Channel

- - newest thread in ⧑ Industrial Control Group

### Slitting saw usage ?

- - the site's newest thread. Posted in ⏣ General Metalworking

### Fadal transformer issue

- - the site's last updated thread. Posted in ⋐⋒⋐ Computer Numeric Control