Upload
truongquynh
View
243
Download
6
Embed Size (px)
Citation preview
123
CHAPTER 6
ALGEBRAIC APPROACH FOR SELECTING
WEIGHTING MATRICES OF LQR
6.1 INTRODUCTION
Over the past few decades, classical optimal control theory has
advanced to formulate the well known optimal state feedback controller called
Linear Quadratic regulator which reduces the deviation in state trajectories of
a system while maintaining minimum control effort. The LQR design is
considered the foundation of the Linear Quadratic Gaussian/Loop Transfer
Recovery (LQG/LTR) design procedure. The significance of the LQR method
can be appraised by its scientific and technical impacts that are reported in
Neto et al (2010). The LQR controller, an optimal state feedback controller, is
used to obtain the optimal performance of the system by minimizing the cost
function which relates the state vector and control input vector. With the aid
Riccati Equation (ARE) which is solved to obtain the transformation matrix
(P) between states and co-states. Then the transformation matrix is used to
determine the state feedback gains for a chosen set of weighting matrices. The
weighting matrices Q and R of LQR regulate the penalties on the excursion in
the trajectories of the state variables (x) and control input (u). Indeed, with
random choice of Q and R matrices, the optimal regulators do not provide
good set point tracking performance due to the absence of integral term unlike
the PID controllers. Therefore, the key problem in the design of optimal
124
controller using LQR is the choice of Q and R matrices. Conventionally,
control engineers often select the weighting matrices based on trial and error
approach, which not only makes the design tedious but also provides a non-
optimized response. Hence, there is a need for a systematic approach in
selecting the weighting matrices. Bryson & Ho (1975) proposed a method to
address this problem using a simple iteration algorithm to optimize the
elements of matrices Q and R. suggests the way to choose
only the initial values of the weighting matrices and after the first trial the
values of weighting matrices are to be iterated to get the optimal response,
which once again leads to manual tuning. One more methodology adopted in
the design of optimal controller is that the initial values of weighting matrices
could be chosen as Q=CCT and R=BBT, and after the initial trial, if the
performance is not satisfactory these weights can be altered again to get the
desired response. However, this approach once again makes use of trial and
error method, which does not result in optimized response. One more idea
was put forward in Anderson & Moore (1989) for the connection between the
selection of weighting matrices and the properties like closed loop eigen
values, uncertainty in the system and robustness, but the exact mathematical
relation between the Q and R matrices were not given.
Analytical way of selecting the Q and R matrices for a second order
crane system was proposed in Omer et al (2010). In this work, we extend the
concept to higher order systems, and propose a systematic frame work for
selecting the weighting matrices of LQR not only based on the steady state
performance but also on transient performance. There are two main
advantages of the proposed methodology. By integrating the solution of ARE
with the design requirement, the algebraic approach provides a systematic
approach for selecting the Q and R matrices according to the time domain
requirement. Second, this approach enables the controller to translate the
125
makes the design of LQR both simple and modular. The algebraic approach is
formulated for both third and fourth order systems, and a torsional system is
taken for experimentation and both the simulation and experiments are carried
out to validate the efficacy of the algebraic approach for selecting the
weighting matrices.
6.2 PROBLEM FORMULATION
Consider a linear time invariant multivariable system
(6.1)
(6.2)
where , , , are system matrix, input
matrix, output matrix and feedforward matrix, respectively. is the state
vector, u is the control input vector, and y is the output vector. The canonical
form of third order state space model considered for the design is given
below.
(6.3)
The conventional LQR problem is to determine the control input
which minimizes the following cost function.
(6.4)
126
where is a positive semidefinite matrix that penalizes the departure of
system states from the equilibrium, and is a positive definite matrix
that penalizes the control input. The solution of the LQR problem, the optimal
control gain K, can be obtained via the following Lagrange multiplier based
optimization technique.
(6.5)
The optimal state feedback control gain matrix K of LQR can be
determined by solving the following Algebraic Riccati Equation (ARE).
(6.6)
where P is a solution of ARE. The weighting matrices Q and R are
important components of an LQR optimization process. The compositions of
Q and R elements have great influences on system performance. The number
of elements of Q and R matrices depend on the number of state variable (n)
and the number of input variable (m), respectively. If the weighting matrices
are selected as diagonal matrices, the quadratic performance index is simply a
weighted integral of the squared error of the states and inputs. Commonly, a
trial and error method has been used to construct the matrices Q and R
elements. This method is cumbersome, time consuming and does not result in
optimum performance. In order to address this issue, in the following section
we propose an analytical procedure for selecting the weight matrices of LQR
based on the time domain specifications of the system to be controlled.
6.3 ALGEBRAIC APPROACH FOR A THIRD ORDER SYSTEM
Implementing a state feedback control using LQR requires the
minimization of the cost function, which places the weight not only on the
127
control input but also on states of the system. The state feedback control law
that minimizes J is given by
(6.7)
By solving the ARE, the transformation matrix P is obtained and
the resultant state feedback gain is calculated using the transformation matrix.
One of the essential features of LQR is that Q should be a positive semi-
definite and symmetric matrix and R should be a positive definite. So, the
weighting matrices Q and R, and the solution of ARE are chosen as
, (6.8)
Using the Lagrange optimization technique, the state feedback gain
matrix K can be calculated as
(6.9)
(6.10)
The three elements of P matrix such as , and are
obtained using the following ARE.
(6.11)
(6.12)
129
6.3.1 Closed Loop Response of the System
The closed loop state equation of the system can be represented as
(6.13)
Eigen values of the closed loop system should have negative real
parts for the closed loop system to be stable. In order to analyze the response
of the system, the actual characteristic equation of the system can be
represented as
(6.14)
On substituting the corresponding system matrix A, input matrix B
and the state feedback controller gain matrix K in the above characteristic
equation results in
(6.15)
The general form of desired characteristic equation of the third
order system is
(6.16)
Comparing equations (6.15) and (6.16), the expressions for ,
and can be obtained as given below.
(6.17)
(6.18)
(6.19)
130
From Equation (6.12),
(6.20)
Substituting Equation (6.17) into Equation (6.20) results in
(6.21)
(6.22)
By rearranging, the expression for can be obtained as
(6.23)
Similarly, from Equation (6.12) can be written as
(6.24)
(6.25)
The element in second row and second column of ARE given in
Equation (6.12) can be rearranged in terms of known quantities such as
, and by substituting Equation (6.25) in the following equation.
(6.26)
(6.27)
131
Substituting in the above equation results in
(6.28)
Rearranging the above equation, the expression for can be
obtained as mentioned below.
(6.29)
In the same manner, the element available in third row and third
column of ARE can be written as
(6.30)
Substituting the values of and in Equation (6.30)
(6.31)
By solving Equation (6.31), we can get
(6.32)
The elements of Q matrix can be obtained from the desired
specifications by fixing the value of R matrix which is taken as scalar in the
present example. The complete design procedure of LQR weight selection
based on damping ratio and natural frequency is summarized below.
132
6.3.2 Design Procedure
1. Represent the mathematical model of the system to be
controlled in state space differential form.
2.
( ) of the system
3. Obtain the state feedback gain matrix K in terms of the
transformation matrix P, which is the solution of ARE.
4. Determine the actual characteristic equation of the system.
5. Evaluate the desired characteristic equation of the system from
the given time domain specifications.
6. Compare the desired characteristic equation with the actual
characteristic equation and obtain the elements of P matrix,
which is the solution of ARE.
7. Substitute the elements of transformation matrix (P) in ARE
and obtain the expressions for , and .
8. Fix the value of r and find the coefficients of Q matrix.
9. Calculate the state feedback gain matrix (K) using the
Lagrange multiplier based optimization technique.
10. Obtain the response of the system to verify that the design
meets the desired specification in terms of settling time and
overshoot.
A nonlinear magnetic levitation plant is chosen to evaluate the
performance of the proposed approach. The mathematical modeling of the
system and LQR controller design based on the analytical approach is
explained in the following section.
133
6.4 STATE MODEL OF MAGNETIC LEVITATION SYSTEM
The magnetic levitation system described in Chapter 4 is chosen to
evaluate the algebraic weight selection approach of LQR. The control
objective is to control the vertical motion of the ball by controlling the current
supplied to the coil. In addition to keeping the ball at reference position, the
controller should also adjust the ball position according to the reference
trajectory. Figure 6.1 illustrates the maglev electrical system. Using
ation can be
obtained.
Figure 6.1 Maglev electrical system
(6.33)
Rearranging Equation (6.33) to obtain the rate of change of coil
current results in
(6.34)
134
The total external force experienced by the ball under the influence
of electromagnet is
(6.35)
where Ic coil current, ball position, g gravitational constant, magnetic
force constant for the electromagnet ball pair.
the nonlinear equation of motion can be obtained as
(6.36)
where and are ball position and coil current at equilibrium point. The
ball position ( , velocity of the ball and coil current ( ) are taken as
state variables of the maglev system. Maglev system is a type of single input
single output nonlinear system, in which the input is coil current and the
output is ball position. The state space representation of the maglev system is
(6.37)
The objective of the control strategy is to regulate and track the ball
in mid-air. The optimal stabilizing controller is to command the control signal
according to the reference trajectory which is sinusoidal wave in the present
example.
6.5 SIMULATION RESULTS
To evaluate the efficacy of the proposed methodology, simulation
is carried out using MATLAB. By substituting the parameter values of
135
maglev system, the mathematical model of the system in canonical state space
form is obtained as given below.
= + U
The open loop eigen values of the system are found to be -57.87,
-26.67 and 57.18. The positive real part of eigen value suggests that the open
loop system is unstable in nature and emphasizes the necessity for a feedback
controller. In this experiment, we selected the damping ratio of the desired
system to be 0.65 with a settling time of 0.28s. Since the given system has
only one input, which is voltage applied to coil, the value of R matrix is
chosen to be 0.001. Then, the corresponding Q matrix obtained via the
proposed methodology is
The solution of ARE for the above weighting matrices are found to be
The optimal state feedback controller gain which satisfies the given
time domain specification is
136
Step response of the system for the above control gains is shown in
Figure 6.2. It can be observed from the response that the ball position reaches
the set point in less than 0.3s, and it does not have any overshoot.
Figure 6.2 Step response of LQR design
Three different values of damping ratio and natural frequency are
considered to evaluate the impulse response of the system. Values of time
domain specification considered for the design and the corresponding
weighting matrices calculated as specified in the design procedure are given
in table 6.1. It can be noted that the value of R can be set to any scalar value
because the approach does not place any constraint on it. This approach not
only reduces the time needed in designing the stabilizing controller, but also
provides the optimized response by selecting the suitable weighting matrices
that can satisfy the time domain requirement.
Table 6.1 Weighting matrices and controller gains for R=0.001
Q K Closed loop eigen
values
0.28s 0.65 6.55
-14.30 +16.72i
-14.30 +16.72i
-14.30
0.4s 0.7
4.2
-10.00+10.21i
-10.00-10.21i
-10.00
0.5s 0.75
3.1
-8.00+7.06i
-8.00-7.06i
-8.00
138
Figure 6.3 Impulse response of ball position
Figure 6.4 Control Signal applied to maglev system
The impulse response of the system for three design requirements
in time domain is shown in Figure 6.3. It can be observed that the response
settles exactly at the specified settling time with the desired overshoot given
in the requirement. Figure 6.4 shows the control signal used in levitating the
ball in mid air, and it is worth to note that the magnitude of control signal is
well below the saturation value. It is important to evaluate the stability of the
139
system while the other performance requirements are met, so to ascertain the
stability, the bode plot of the system for three natural frequencies is plotted
and shown in Figure 6.5. Positive gain margins of all the three cases suggest
that the system is stable and it can also accommodate the disturbances present
in the system.
Figure 6.5 Bode plot of maglev system
6.5.1 Trajectory Tracking of Maglev System
The performance of the controller to track the reference signal is
tested by providing sinusoidal input to the system. Three reference signals
with different time domain requirements in terms of settling time and
damping ratio are tested, and the results are shown in Figure 6.6. It can be
observed from the trajectory tracking error given in Table 6.2 that the error
between actual trajectory and reference trajectory increases as the settling
time shoots up.
140
(a)
(b)
(c)
Figure 6.6 Sine wave trajectory for a) ts=0.5 and =0.75 b) ts=0.4 and =0.7 c) ts=0.28 and =0.65
141
Table 6.2 Trajectory tracking error of maglev system
Parameter ts=0.5 & =0.75 ts=0.4 & =0.7 ts=0.28 & =0.65
RMSE 0.26 0.19 0.13
6.6 ALGEBRAIC APPROACH FOR A FOURTH ORDER
SYSTEM
Consider the following system matrices of a fourth order canonical
state space model.
The weighting matrices Q and R, and the solution of ARE are chosen as
Using the Lagrange optimization technique, the state feedback gain
matrix K can be calculated as
= (6.38)
= (6.39)
The ARE for the system is
(6.40)
(6.41)
143
The closed loop state equation of the system can be represented as
(6.42)
From the plant model, the actual characteristic equation can be calculated as
(6.43)
22 2 234 4114 41 24 41 44 41
14 24 4434
01 010 0
00 0 1
ss
s
p Bp B p B p BA A AAr r rr
(6.44)
On substituting the corresponding system matrix A, input matrix B
and the state feedback controller gain matrix K in the above characteristic
equation results in
(6.45)
The general form of desired characteristic equation of a fourth
order system is
(6.46)
Comparing Equations (6.45) and (6.46), the expressions for
, , and can be obtained as given below.
(6.47)
144
(6.48)
(6.49)
(6.50)
From the ARE given in Equation (6.41)
=0 (6.51)
Substituting (6.47) into (6.51) results in
(6.52)
By rearranging, the expression for can be obtained as
(6.53)
Similarly, from Equation (6.41), can be written as
(6.54)
(6.55)
The element in second row and second column of ARE given in
Equation (6.41) can be rearranged in terms of known quantities such as
, , and by substituting the Equation (6.55) in the following
expression.
145
(6.56)
(6.57)
(6.58)
Substituting the expressions for in the above equation
(6.59)
Rearranging the above equation, the expression for can be
obtained as below.
(6.60)
In the same manner, the element available in third row and third
column of ARE can be written as
(6.61)
(6.62)
The element in second row and second column of ARE is
(6.63)
146
(6.64)
(6.65)
Substituting the and in the above equation,
(6.66)
By solving the above Equation (6.66) we can get
(6.67)
From ARE
(6.68)
Substituting the values of and in the above Equation (6.68),
(6.69)
By rearranging the above Equation (6.69),
(6.70)
147
Fixing the value of R matrix, which is a scalar in the present
example, the elements of Q matrix can be obtained according to the desired
specifications. The design procedure of Q and R matrices selection of LQR
for a fourth order system is summarized below.
6.6.1 Design Procedure for Fourth Order Plant
1. Obtain the mathematical model of the system to be controlled
in state space differential form.
2. Specify
( ) of the system
3. Represent the state feedback gain matrix K in terms of
transformation matrix P using Equation (6.39).
4. Determine the actual characteristic equation of the system.
(6.71)
5. Evaluate the desired characteristic equation of the system from
the given time domain specifications.
(6.72)
6. Compare the desired characteristic equation with the actual
characteristic equation and obtain the elements of P matrix.
(6.73)
148
7. Substitute the values of , and in ARE and
obtain the expression for , .and .
(6.74)
8. Fix the value of r because the system has only one input, and
find the elements of Q matrix using the above expressions.
9. Calculate the state feedback gain matrix (K) using the
Lagrange multiplier based optimization technique.
10. Obtain the response of the system to verify that the design
meets the desired specification in terms of settling time and
overshoot.
To assess the performance of the proposed approach, 1 DoF torsion
module is taken for experimentation. In the following section, the
mathematical model of the plant, which is derived from the first principles,
and the algebraic based weight selection approach are explained.
6.7 TORSIONAL POSITION CONTROL SYSTEM
Figure 6.7 illustrates the block diagram of torsional system, which
consists of a DC motor, an instrumented bearing block, and a torsional load
with two masses attached to the shaft of the DC motor. DC motor shaft is free
to rotate inside the bearing block, and the shaft position and torsion module
position are measured by encoders. The control objective is to control the
149
position of the torsional load with minimum vibration using full state
feedback controller design via LQR. Since the shaft of the torsion and DC
motor are coupled, by controlling the voltage applied to the motor the position
of both motor shaft angle and torsion shaft angle can be controlled. So it is a
type of Single Input Multi Output (SIMO) system, which has DC motor
voltage as input and motor shaft angle and torsion shaft angle as outputs.
Moreover, such a system emulates torsional compliance and joint flexibility
that are common characteristics in mechanical systems namely high-gear-ratio
harmonic drives or lightweight transmission shafts.
Figure 6.7 Block diagram of torsional system
6.7.1 Mathematical Modeling
The mathematical model of the flexible torsional system is obtained
(6.75)
The mass balance equation at the torsion load can be represented as,
(6.76)
150
Four system variables namely motor shaft angle ( ), motor shaft
velocity ( ), torsion shaft angle ( ) and torsion shaft velocity ( are taken
as state variables, and the motor voltage ( ) is considered a input variable.
Hence the state and input variables are,
(6.77)
By substituting the state variables in above equations,
(6.78)
(6.79)
Rearranging the Equations (6.78) and (6.79),
(6.80)
(6.81)
The state space representation of 1-DOF torsion system is
(6.82)
(6.83)
151
6.8 RESULTS AND DISCUSSION
Figure 6.8 Snapshot of experimental set up of torsional system
Table 6.3 Torsional system parameters
Symbol Description Value
J1 Equivalent moment of inertia at motor shaft 0.0022 2B1 Equivalent Viscous damping at motor shaft 0.0150
Mb Disc weight mass 0.0022 kg Dw Disc weight diameter 0.0380 m Ks Flexible coupling stiffness 1 N.m/rad Lb Load support bar length 0.044 m J2 Equivalent moment of inertia at torsion load shaft 5.45 10-4 B2 Equivalent Viscous damping at torsion load shaft 0.015
The experimental set up, as shown in Figure 6.8, consists of a DC
servo unit, torsion module, power amplifier and a PC. The proposed control
algorithm is realized in the PC using the real time algorithm, QUARC, which
is similar to C like language. The sampling interval is chosen to be 0.001s. By
substituting the parameter values of torsional system from Table 6.3 into
Equation (6.78) and (6.79), the following mathematical model is obtained in
state-space form.
152
(6.84)
Using similarity transformation the above state space model is
converted into the controllable canonical form as given below.
(6.85)
An optimal state feedback regulator via LQR is designed to control
the motion of the torsion system with reduced vibrations. The objective is to
control the position of the torsion load shaft by controlling the DC motor
shaft. For one sample value of settling time and damping ratio, the
coefficients of Q and R matrices are explained below.
The controller should result in a response which has a settling time
of 0.2s and an overshoot of less than 5%. The value of damping ratio from the
settling time is calculated using the following expression.
(6.86)
153
The damping ratio of the system for the given specification is found
to be 5. The control input which is voltage applied to the DC motor is
restricted to . Since it is a single input system, the value of R can be
fixed to any scalar which will meet the constraint on the control input. Then,
fixing the value of R makes the selection of Q matrix straight forward, and the
diagonal elements of Q matrix are found to be
Then, the weighting matrices are used to find the following
transformation matrix P.
Using the Lyapunov optimization method, the corresponding state
feedback gain is found to be
Angular position response of both the torsion load and motor shaft
are shown in Figure 6.9 and 6.10. The time domain parameters of torsion load
shaft angular response is given in Table 6.4. It is worth to note that in the real
time results the settling time and the overshoot of the torsion load shaft is
found to be 0.18 and 4% which is very close to the design specifications. The
motor shaft velocity and torsion load shaft velocity are shown in Figures 6.11
and 6.12. Figure 6.13 illustrates the control signal (Vm) applied to the DC
motor, and it is worth to mention that the control input is maintained below
the saturation value which is 10V in the present case.
154
Figure 6.9 Motor shaft angular position
Figure 6.10 Torsion load shaft angular position
Figure 6.11 Motor shaft angular velocity
155
Figure 6.12 Torsion shaft angular velocity
Figure 6.13 Control signal
Table 6.4 Torsion load shaft angular position
Parameters Simulation Real time
Theta1 Theta2 Theta1 Theta2
ts 0.12 0.18 0.2 0.21
%Mp 4.8 4.75 4.9 4.85
tr 0.09 0.15 0.11 0.18
156
6.8.1 Trajectory Tracking of Torsional system
To assess the trajectory tracking performance of the controller, a
sinusoidal signal of 0.5Hz frequency is given as an input to the torsion
system. The response of both and are shown in Figures 6.14 and 6.15,
and from the response the deviation between reference signal and real time
signal is found to be 0.01. The error signals are illustrated in Figures 6.16 and
6.17. Table 6.5 gives the trajectory tracking error of both the torsion shaft
angle and motor shaft angle. The minimum value of RMSE suggests that the
proposed algorithm can effectively track the given reference signal.
Table 6.5 Trajectory tracking error of torsion system
Parameter RMSE IAE
Theta1 0.6484 109.6
Theta 2 0.3727 111.1
Figure 6.14 Sinusoidal trajectory of motor shaft angle
157
Figure 6.15 Sinusoidal trajectory of torsion shaft angle
Figure 6.16 Motor shaft angle error
Figure 6.17 Torsional load shaft error
158
6.9 CONCLUSION
Conventionally, the Q and R matrices of LQR are chosen based on
iterative approach, which not only makes the design tedious but also results in
non optimal response. Hence to address the weight selection problem of LQR,
an algebraic approach based weight selection algorithm is proposed. The
systematic way of selecting the weighting matrices based on the required
damping ratio and settling time of the system is formulated by incorporating
the time domain requirements into the cost function. The novelty of this
approach is that the elements of Q and R matrices are chosen based on simple
mathematical expressions which satisfy both the transient and steady state
design requirements. Experiments are conducted on a torsional system to
assess the effectiveness of the approach. The experimental results suggest that
the proposed approach can be effectively employed for designing the tuning
parameters of the LQR, and it significantly reduces the time required in the
design of optimal state feedback controller.