design of state feedback optimal controller using riccati equation for the dc servo motor

15
Abstract This paper deals with the closed loop optimal control based on linear quadratic regulator to design state feedback optimal controller using riccati equation for the DC servo motor .The optimal control input and optimal states of servo motor system will be studied to know what is the effect on the system with changing the symmetric weighting matrices Q&R . 1-Introduction A servo motor system is one of the most important and widely used forms of control systems.Any machine or piece of equipment that has rotating part will contain one or mor servo control systems. The basic form of a DC servo system is made of an electric motor with an output shaft that has an inertial load J on it, and friction in the bearings of the motor and load (represented by the constant b). There will be an electric drive circuit where an input voltage u(t) is transformed by the motor into a torque T(t) in the motor output shaft. Using systems modelling ideas for mechanical systems a torque balance can be written between the input torque from the motor and the torque required to accelerate the load and overcome friction. This is shown in the equation . J + b = T (t) Where θ is the angular position of the servo output shaft. The control objective is to control the shaft position θ or the shaft velocity to be some desire value.The input voltage u(t) is related to the torque T(t) by a gain K and the inertia divided by the friction coefficient is referred to as the system time constant , where =J/b. So the system model becomes: τ + = Ku(t) In a practical servo system there will be additional components of the model which are important. Many of these are to do with the nonlinearities in the drive amplifier and friction in the mechanical components.The most important nonlinearities are the saturation voltage of the motor drive amplifier, the deadband in the amplifier, the so-called Coulomb friction in the rotating mechanical components and hysteresis (backlash) in any gearboxes that might be between the motor and the load. A good control system must include features to deal with these nonlinear features.In this paper we will concentrate on the linear parts of the servo system.The linear part of the servo system model can be put in the transfer function form: U(s) Y(s)= Where v(s)= U(s) & y(s)= v(s) y(s) is the output shaft position, u(s) is the motor input and v(S) is the motor speed. K is the system gain and is the time constant. In servo systems the states are the velocity and position of the servo system output shaft .

Upload: halabicom-nsprt

Post on 28-Jul-2015

87 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

Abstract

This paper deals with the closed loop optimal control based on linear quadratic regulator to design state feedback optimal controller using riccati equation for the DC servo motor .The optimal control input and optimal states of servo motor system will be studied to know what is the effect on the system with changing the symmetric weighting matrices Q&R .

1-Introduction

A servo motor system is one of the most important and widely used forms of control

systems.Any machine or piece of equipment that has rotating part will contain one or mor servo

control systems.

The basic form of a DC servo system is made of an electric motor with an output shaft that

has an inertial load J on it, and friction in the bearings of the motor and load (represented by

the constant b). There will be an electric drive circuit where an input voltage u(t) is transformed

by the motor into a torque T(t) in the motor output shaft. Using systems modelling ideas for

mechanical systems a torque balance can be written between the input torque from the motor

and the torque required to accelerate the load and overcome friction. This is shown in the

equation .

J + b = T (t)

Where θ is the angular position of the servo output shaft. The control objective is to

control the shaft position θ or the shaft velocity to be some desire value.The input voltage u(t)

is related to the torque T(t) by a gain K and the inertia divided by the friction coefficient is

referred to as the system time constant , where =J/b. So the system model becomes:

τ + = Ku(t)

In a practical servo system there will be additional components of the model which are

important. Many of these are to do with the nonlinearities in the drive amplifier and friction in

the mechanical components.The most important nonlinearities are the saturation voltage of the

motor drive amplifier, the deadband in the amplifier, the so-called Coulomb friction in the

rotating mechanical components and hysteresis (backlash) in any gearboxes that might be

between the motor and the load. A good control system must include features to deal with

these nonlinear features.In this paper we will concentrate on the linear parts of the servo

system.The linear part of the servo system model can be put in the transfer function form:

U(s)Y(s)=

Where v(s)=

U(s) & y(s)=

v(s)

y(s) is the output shaft position, u(s) is the motor input and v(S) is the motor speed. K is the

system gain and is the time constant. In servo systems the states are the velocity and position

of the servo system output shaft .

Page 2: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

2-Problem formulation

For the Dc servo motor control system

G(s)=

If k=1 & ,therefore, the servomotor system has the transfer function :

G(s)=

The state space representation of this system

Y=[0 1]x

The problem is formulated as:

find the control u that minimizes the cost function

Where tf is free& long , r is greater than zero

to transfer the state from initial to the origine and what are the effects of changing Q& R to the

servo motor .

3-Background

3.1 Infinite–Time invariant LQR

this means that the settings of a (regulating) controller governing either a machine or

process (like an airplane or chemical reactor) are found by using a mathematical algorithm that

minimizes a cost function with weighting factors supplied by a human (engineer). The "cost"

(function) is often defined as a sum of the deviations of key measurements from their desired

values. In effect this algorithm therefore finds those controller settings that minimize the

undesired deviations, like deviations from desired altitude or process temperature. Often the

magnitude of the control action itself is included in this sum as to keep the energy expended by

the control action itself limited.In effect, the LQR algorithm takes care of the tedious work done

by the control systems engineer in optimizing the ontroller. However, the engineer still needs to

specify the weighting factors and compare the results with the specified design goals. Often this

means that controller synthesis will still be an iterative process where the engineer judges the

produced "optimal" controllers through simulation and then adjusts the weighting factors to get

a controller more in line with the specified design goals.

Page 3: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

The LQR algorithm is, at its core, just an automated way of finding an appropriate state-

feedback controller. And as such it is not uncommon to find that control engineers prefer

alternative methods like full state feedback (also known as pole placement) to find a controller

over the use of the LQR algorithm. With these the engineer has a much clearer linkage between

adjusted parameters and the resulting changes in controller behaviour. Difficulty in finding the

right weighting factors limits the application of the LQR based controller synthesis.

The linear quadratic regulator (LQR) is a well-known design technique that provides

practical feedback gains.For a controllable, linear,time-invariant system as:

And the cost functional as

Where x(t) is nth order state vector ,u(t) is rth order control vector ,A is n*n order state matrix

,B is r*r order control matrix ,Q is symmetric ,positive semidefinite matrix , R is symmetric

,positive definite matrix .With infinite final time , the final cost term involving F(tf) does not

exist in the cost functional .

In the case of finite final time, we can proceed and obtain the closed-loop optimal control and

the associated Riccai equation.Still P(t) must be the solution of the matrix differential Riccati

equationwith boundary condition P(t)=0.

F(t)=0 implay that 0

Where , .P is the positive definite ,symmetric,constant matrix .P is the solution of the nonlinear ,

matrix , algebraic Riccati equation .

The optimal control is given by

=

And the optimal trajectory is solution of

And the optimal cost is given by

Page 4: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

3.2 Procedure Summary of LQR System

The entire procedure is now summarized as the following:

Step1: Solve the matrix algebraic Riccati equation

Step2: Solve the optimal state x(t) from

With initial condition x(t0)=x0

Step3: Obtain the optimal control u from

=

Step4: Obtain the optimal performance index from

And the implementatation of the closed-loop optimal control is shown in fig.1

Fig.1 Implementatation of the Closed-Loop Optimal Control,Infinite Final Time

Page 5: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

4-Open Loop Simulation

Fig.2 Open Loop Sysem for servo motor

4.1 SIMULATION RESULTS

(a)

(b)

Fig3.(a)&(b) Open Loop System states curves

Page 6: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

5-Optimal Controller Design Using Riccati Equation

We will start the design with changing the factors R and Q to see the difference between them:

5.1Changing weighting Factor R

In this section ,F two cases have been tested.The first one,R is set to be 2 value .As for the

second, R is increased to 5.

Case1:R=2 x0=[2;3] ; % initial condition on states x1 and x2 A=[0 1; 0 -1]; % system matrix A B=[0;1] ; % system matrix B Q =[1 0;0 1]; %performance index weighted matrix

% when : R=2 ; [K,P,EV]=lqr(A,B,Q,R) % K=feedback matrix ; % P=Riccati Matrix ; %EV=eigenvalues of closed loop system A-B*K J=0.5*x0'*P*x0

K =

0.7071 0.7071

P =

2.4142 1.4142

1.4142 1.4142

EV =

-0.7071

-1.0000

J =

19.6777

Now , optimal control u= -[0.7071 0.7071 ]x

The design of of the closed-loop optimal control is shown in fig.

Page 7: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

Fig.4 Optimal Controller design

The Table5.1 shows the computed feedback gain matrix with different value of R

K R

[0.7071 0.7071]

2

[0.4472 0.4472]

5

Table5.1 different control gain k with different weighting R

The simulation results for case1 are shown in fig5

5.2 SIMULATION RESULTS

Page 8: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

(a)

(b)

(c)

Fig5.case1(R=2)(a)optimal state x1. (b) optimal state x2. (C) optimal control u.

Case2:R=2 x0=[2;3] ; % initial condition on states x1 and x2 A=[0 1; 0 -1]; % system matrix A B=[0;1] ; % system matrix B Q =[1 0;0 1]; %performance index weighted matrix

% when : R=5 ; [K,P,EV]=lqr(A,B,Q,R) % K=feedback matrix ; % P=Riccati Matrix ; %EV=eigenvalues of closed loop system A-B*K J=0.5*x0'*P*x0

K =

0.4472 0.4472

Page 9: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

P =

3.2361 2.2361

2.2361 2.2361

EV =

-0.4472

-1.0000

J =

29.9508

The simulation results for case2 are shown in fig6

5.3 SIMULATION RESULTS

(a)

(b)

Page 10: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

(c)

Fig6.case1(R=5)(a)actual angle x1. (b) motor speed x2. (C) optimal control u (servo input)

The two simulation results shows that when R is small , the state x are able to converge to zero at faster

response .However, control signal , u, is larg as compared the original simulated results.

It could be explained theoretically, as R the weighting factor of input u with respect to the cost function , if R

is small,u can be every larg because it is no longer the major cost concern .On the other hand,if R is larg,u

becomes very costly and the controller will try to keep it small.We can say the larg feedback gain will

cause faster system response.

5.1Changing weighting Factor Q

Case1:Q=[2 0, 0 3] x0=[2;3] ; % initial condition on states x1 and x2 A=[0 1; 0 -1]; % system matrix A B=[0;1] ; % system matrix B R=1 ;

% when : Q =[2 0;0 3]; %performance index weighted matrix

[K,P,EV]=lqr(A,B,Q,R) % K=feedback matrix ; % P=Riccati Matrix ; %EV=eigenvalues of closed loop system A-B*K J=0.5*x0'*P*x0

Page 11: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

K =

1.4142 1.6131

P =

3.6955 1.4142

1.4142 1.6131

EV =

-1.8478

-0.7654

J =

23.1354

The Table5.1 shows the computed feedback gain matrix with different value of Q

K Q

[1.4142 1.6131] [2

0;0 3] [2.4495 2.1463] [6 0;0

4];

Table5.1 different control gain k with different weighting Q

The simulation results for case1 are shown in fig7

5.4 SIMULATION RESULTS

Page 12: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

(a)

(b)

(b)

Fig7.case1(Q=[2 0 ;0 3 ])(a)actual angle position x1. (b) optimal state (speed servo) x2.(C) optimal control

u

Case2:Q=[6 0, 0 4]

x0=[2;3] ; % initial condition on states x1 and x2 A=[0 1; 0 -1]; % system matrix A B=[0;1] ; % system matrix B R=1 ;

% when : Q =[6 0;0 4]; %performance index weighted matrix

[K,P,EV]=lqr(A,B,Q,R) % K=feedback matrix ; % P=Riccati Matrix ;

Page 13: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

%EV=eigenvalues of closed loop system A-B*K J=0.5*x0'*P*x0

K =

2.4495 2.1463

P =

7.7067 2.4495

2.4495 2.1463

EV =

-1.7321

-1.4142

J =

39.7686

The simulation results for case1 are shown in fig8

5.5 SIMULATION RESULTS

(a)

Page 14: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

(b)

(c)

Fig8.case2(Q=[6 4 ;5 4 ])(a)optimal state x1. (b) optimal state x2.(C) optimal control u

According to fig and fig ,we see that for Q=[6 0 ;0 4] ,the system response are slower compared to the

case1(Q=[ 2 0 ; 0 3 ].This is due to the increment of the weighting of state x2

Page 15: Design of State Feedback Optimal Controller Using Riccati Equation for the DC Servo Motor

6-Conclusions

In this project, we investigated the LQR in optimal control of servo motors. The simulation results showed

that the proposed design has better performance for the sake of design . the given single input single output

plant is converted into the state space representation.the plant's open loop dynamics is analyzed and

simulated.State feedback control using the LQR method is implemented and the effects of changing

weighting factor Q and R are investigated .

7-References

1. Chee-Mun Ong, “Dynamic Simulation of Electric Machinery”, Prentice Hall, New Jersey, 1998 .

2. Jeffrey B.Burl,"Linear optimal control", Addison Wesley Longman, Inc, 1999.

3. C. L. Phillips and R.D.Habror,Feedback Control Systems,4th ed.Prentic Hall,Inc 2000.

4. Donlad E.kirk. "Optimal Control Theory An Introduction",2d ed, Prentice –Hall,USA1970.

5. C.K Benjamin,Automatic Control Systems,Third Edition,Englewood Cliffs,Prentice-Hall Inc,1975.

6. The Mathworks, Inc. Matlab Online Help version 8.