You are on page 1of 33

AUTOMATIC TUNING OF PID CONTROLLER USING

MODEL REFERENCE ADAPTIVE CONTROL


The mini Project Report submitted in partial fulfillment of the requirements
For the award of the Degree in Bachelor of Technology
In
(Electrical and Electronics Engineering)
By
B.ASHA (08FE1A0207)

V.MANIDEEP (08FE1A0229)

J.PRANAVI (08FE1A0235)

G.KARTHIK (08FE1A0224)

Under the esteemed Guidance of


Mr.G.R.S.Naga Kumar, M.Tech,
Assistant Professor
Department of Electrical and Electronics Engineering
VIGNAN'S LARA INSTITUTE OF TECHNOLOGY & SCIENCE
(Affiliated to Jawaharlal Nehru Technological University, Kakinada)
Vadlamudi 522 213
Guntur District, Andhra Pradesh
2011-2012.

VIGNAN'S LARA INSTITUTE OF TECHNOLOGY &


SCIENCE
(Affiliated to Jawaharlal Nehru Technological University, Kakinada)
Vadlamudi 522 213
Guntur District, Andhra Pradesh
Department of Electrical and Electronics Engineering

C E R T I F I C AT E
This is to certify that this dissertation entitled as AUTOMATIC
TUNING OF PID CONTROLLER USING MODEL REFERENCE ADAPTIVE
CONTROL is the bonafide work of, B.Asha, J.Pranavi, V.Manideep, G.Karthik submitted to
the Department of Electrical and Electronics Engineering, VIGNANS LARA INSTITUTE
OF TECHNOLOGY AND SCIENCE in partial fulfillment of the requirements for the
award of the Degree in Bachelor of Technology in Electrical and Electronics Engineering.

Project Guide

G.R.S.Naga Kumar, Asst.Prof.

Head of the Department


Electrical and Electronics Engineering

D E C LAR AT I O N
We, the students of Vignans Lara Institute of Technology and Science, Vadlamudi,
Guntur District,

Andhra Pradesh, hereby declare that this Project Work titled as

AUTOMATIC TUNING OF PID CONTROLLERS USING MODEL REFERENCE


ADAPTIVE CONTROL, submitted to the Department of Electrical and Electronics
Engineering of this Institute, affiliated to Jawaharlal Nehru Technological University,
Kakinada, for the award of the Degree in Bachelor of Technology in

Electrical and

Electronics Engineering is a record of bonafide work done by us at VIGNANS LARA


INSTITUTE OF TECHNOLOGY & SCIENCE and it has not been submitted to any other
Institute or University for the award of any other Degree.

Project members are

B.Asha (08FE1A0207)
J.Pranavi (08FE1A0235)
V.Manideep (08FE1A0229)
G.Karthik (08FE1A0224)

ACKNOWLEDGEMENT

We would like to express our deep gratitude to our beloved director


V.MADHUSUDHANA RAO, for his cooperation in completing our project.
We found immense pleasure in expressing our gratitude and hearty things to
A.N.VENKATESWARLU, Head of Electrical and Electronics Engineering department for
his timely help throughout the project schedule and the course of study.
We would like to express our sincere thanks to our beloved guide G.R.S.Naga
Kumar. for his active participation and excellent guidance at every stage and for high
dynamic and motivate encouragement in successfully completing this project.
Finally, we express our sincere thanks to all the faculty and staff members and
also another man who are directly or indirectly involved and support in completing our
project.

B. ASHA
J. PRANAVI
V. MANIDEEP
G. KARTHIK

INDEX
Abstract
List of figures
List of tables
CHAPTER 1 INTRODUCTION
1.1Inrtoduction
1.2 Motivation
1.3 Problem identification
1.4 Objective of the project
1.5 Conclusion

CHAPTER 2 LITERATURE REVIEW


2.1 Introduction
2.2 Existing system
2.3 Disadvantages of existing system
2.4 Proposed system
2.5 Conclusion

CHAPTER 3 BLOCK DIAGRAM OF MRAC


3.1 Introduction
3.2 Block diagram
3.2.1 Inner loop

3.2.2 Outer loop


3.3 Components
3.3.1 Reference model
3.3.2 Controller
`

3.3.3 Adaptive mechanism


3.4 Conclusion

CHAPTER 4 PID CONTROLLER


4.1 Introduction
4.2 Proportional
4.3 Integral
4.4 Derivative
4.5 PID controller
4.6 Conclusion

CHAPTER 5 SPEED CONTROL OF DC MOTOR


5.1 Introduction
5.2 Mathematical analysis
5.2.1 MIT rule
5.3 Tuning
5.4 Adaptive mechanism
5.5 Modelling of DC motor

5.5.1 Mathematical analysis of DC motor


5.6 Conclusion

CHAPTER 6 SIMULATION AND RESULTS


6.1 Introduction
6.2 Simulation diagram
6.3 Results
6.4 Conclusion

CHAPTER 7 CONCLUSION

LIST OF FIGURES
Figure 3.1 Block diagram of MRAC
Figure 4.1 Block diagram of PID controller
Figure 5.1 DC motor
Figure 6.1 Simulation diagram of PID controller
Figure 6.2 Output of PID controller for square wave input
Figure 6.3 Output of various parameters for square wave input
Figure 6.4 Output of PID controller for Sine wave input
Figure 6.5 Output of various parameters for sine wave input

LIST OF TABLES
Table 5.1 Table for various parameters of DC motor

ABSTRACT
This project discusses the application of Model Reference Adaptive Control concepts
to the automatic tuning of PID controllers. The effectiveness of the proposed method is
shown through simulated applications. A Model Reference Adaptive Control algorithm is
proposed. This algorithm preserves all the best features of MRAC such as Lyapunov stability,
and asymptotic convergence of the tracking error. In addition, dynamics of DC motor, load
changes, noises, and disturbances are taken into account and assumed to be completely
unknown. The system is examined under various uncertainties such as load variations, noisy
measurements and field disturbances. Experimental results have shown that the proposed
control algorithm is more robust than Time Delay Control, and conventional PID controller

In DC motor drives, device aging and environmental factors


can degrade the performance of the control system and make it difficult to redesign controller
parameters in real time. In this paper, an algorithm that combines PID control scheme and
Model Reference Adaptive Control (MRAC) to autotune the controller parameters in real
time when system performances change is proposed and applied to control of the DC
electromotor drive. The algorithm modifies the traditional PID control scheme by replacing
the error between the reference and the system output with the direct system output in the
derivative part. Compared to the traditional MRAC approach, the algorithm is normalized so
that a reference model can be easily generated given bandwidth requirement. To be practical
for implementation, the algorithm also simplifies the transfer function of the speed open-loop
as an integrator by adding a current inner loop. The results of simulation on a two loop servo
control system show that the adjusted controller parameters meet the system design very well.
The algorithm was implemented on a test platform and the performance of the system was
evaluated with a dynamic signal analyzer. The effectiveness of the proposed method is shown
through the experimental results.

CHAPTER - 1
INTODUCTION

1.1INTRODUCTION:This chapter gives the information about the motivation, problem definition
and objective of the project

1.2MOTIVATION:Over the past 50 years, several methods for determining PID controller
parameters have been developed for stable processes that are suitable for auto-tuning and
adaptive control, such as Ziegler-Nichols frequency-response method and so on. However,
these tuning methods use only a small amount of information about the dynamic behavior of
the system, and often do not provide good tuning. Performances of controllers play important
roles in process industry, or electromechanical systems.
1.3 PROBLEM IDENTIFICATION:Although the adaptive controllers improve responses of the nonlinear systems
and systems with variable parameters, they are not yet used very often. The obvious reason is
their complexity. The signal adaptation ensures fast adaptation process, but the signal in such
case contains high frequency oscillations, so that the signal adaptation system is more likely
to be realized in analogous technique rather than in digital technique.
In parameter model reference adaptation, the problem of high frequency does
not exist. The idea of the model reference adaptive control (MRAC) is based on forcing the
plant to follow the reference model, i.e. the adaptive controller has to decrease the error
vector between the reference model and plant to zero

1.4 OBJECTIVE OF THE PROJECT

An autotuning method is proposed using Model Reference Adaptive


Control (MRAC) concepts and the MIT rule. Many adaptive control techniques can be used
to provide automatic tuning. In such applications the adaptation loop is simply switched for a
period of time when tuning is required. Perturbation signals are normally added to improve
parameter estimation. The adaptive controller is run until the performance is satisfactory; then
the adaptation loop is disconnected, and the system is left running with fixed controller
parameters.

1.5 CONCLUSION
This chapter discussed the motivation and the objective of the project

CHAPTER 2

LITERATURE REVIEW

2.1 INTRODUCTION:Proportional+Integral+Derivative (PID) Controllers are the Building blocks


of Industrial Automation. In industrial applications, more than 90% of control loops are PID
type, because of these are very flexible and it is useful in many situations particularly at
lowest levels, as no other controllers match the simplicity, clear functionality, applicability,
and ease of use offered by the PID controller.
The performance of the PID controller is mainly determined by the choice of
its parameters known as TUNING.
Adaptive control is the control method used by a controller which must adapt
to a controlled system with parameters which vary, or are initially uncertain.
An algorithm that combines PID control scheme and Model Reference
Adaptive Control (MRAC) to autotune the controller parameters in real time when system
performances change is proposed. The algorithm modifies the traditional PID control scheme
by replacing the error between the reference and the system output with the direct system
output in the derivative part.

2.2 EXISTING SYSTEM:The time-honored Ziegler-Nichols tuning rule ("Z-N rule"), as introduced in
the 1940s, had a large impact in making PID feedback controls acceptable to control
engineers. PID was known, but applied only reluctantly because of stability concerns. With
the Ziegler-Nichols rule, engineers finally had a practical and systematic way of tuning PID
loops for improved performance.

2.3 DISADVANTAGES OF EXISTING SYSTEM:The disadvantages of existing Ziegler-Nichols method are as follows.

1. Further fine tuning is needed.


2. Controller settings are aggressive, resulting in large overshoot and oscillatory responses.
3. Poor performance for processes with a dominant delay.
4. Closed loop very sensitive to parameter variations.
5. Parameters of the step response may be hard to determine due to measurement noise

2.4 PROPOSED SYSTEM:The adaptive control process is one that continuously and automatically
measures the dynamic behavior of plant, compares it with the desired output and uses the
difference to vary adjustable system parameters or to generate an actuating signal in such a
way so that optimal performance can be maintained regardless of the system changes. The
nature of the adaption mechanism for controlling the system performance is greatly affected
by the value of adaption gain. As compared to the fixed gain controllers, the adaptive
controllers are very effective to handle the situations where the parameter variations and
environmental changes are frequent.

2.5 CONCLUSION:Application of MIT rule in a model reference adaptive controller results


clearly to an improvement in systems performance. The tracking error is tending to zero and
the performance of the actual plant is approaching the performance of the reference model.

CHAPTER - 3

BLOCK DIAGRAM OF MRAC


3.1 INTRODUCTION
This chapter gives the information about the block diagram of the Model
Reference Adaptive Control and their blocks
3.2 BLOCK DIAGRAM:The model reference adaptive control (MRAC) was originally proposed to
solve a problem in which the specifications are given in terms of a reference model that tells
how the process output should responds to the command signal. The MRAC which was
proposed by Whitaker in 1958. It contains mainly two loops.
1. Inner loop
2. Outer loop

3.2.1. Inner loop:This is also called as REGULATOR LOOP. This is an ordinary control loop
consisting of the plant and the regulator.

3.2.2. Outer loop:This is also called as ADAPTATION. This adjusts the parameters of the regulator in
such a way as to drive the error between the model output and the plant output to zero.
The block diagram of the MODEL REFERENCE ADAPTIVE
CONTROL is as shown in below

Reference
Model y Adjustment
Contro
m Mechanism
ller od
uController
u Plant
c

Param
el
eters

y
p
l
a
n
t

Fig 3.1: block diagram of MRAC

3.3 COMPONENTS
The various blocks in the Model Reference Adaptive Controller are:
1. Reference model
2. Controller
3. Adaption mechanism

3.3.1. Reference model:It is used to specify the ideal response of the adaptive control system to
external command. It should reflect the performance specifications in control tasks. The ideal
behavior specified by the reference model should be achievable for the adaptive control
system.

3.3.2. Controller:It is usually parameterized by a number of adjustable parameters. The control


law is linear in terms of the adjustable parameters (linear parameterization). Adaptive
controller design normally requires linear parameterization in order to obtain adaptation
mechanism with guaranteed stability and tracking convergence. The values of these control
parameters are mainly dependent on adaptation gain which in turn changes the control
algorithm of adaptation mechanism.

3.3.3 Adaptation mechanism:Adaptive control involves modifying the control law used by the controller to
cope with the fact that the parameters of the system being controlled change drastically due to
change in environmental conditions or in system itself. This technique is based on the
fundamental characteristic of adaptation of living organism. The adaptive control process is
one that continuously and automatically measures the dynamic behavior of plant, compares it
with the desired output and uses the difference to vary adjustable system parameters or to
generate an actuating signal in such a way so that optimal performance can be maintained
regardless of system changes. Nature of adaptation mechanism for controlling the system
performance is greatly affected by the value of adaptation gain. It is observed that for the
lower order system wide range of adaptation gain can be used to study the performance of the
system. As the order of the system increases the applicable range of adaptation gain becomes
narrow. The rule which is used for this application is MIT rule. Simulation is done in
MATLAB and simulink and the results are compared for varying adaptation mechanism due
to variation in adaptation gain.

3.4 CONCLUSION
In this chapter the block diagram of Model Reference Adaptive control is
explained and various blocks are also explained.

CHAPTER - 4
PID CONTROLLER

4.1 INTRODUCTION
This chapter gives the information about the PID (proportional + integral +
derivative) controller and the mathematical analysis of PID controller

4.2 PROPORTIONAL
The proportional term makes a change to the output that is proportional to the
current error value. The proportional response can be adjusted by multiplying the error by a
constant Kp, called the proportional gain. The proportional term is given by:

A high proportional gain results in a large change in the output for a given change in the
error. If the proportional gain is too high, the system can become unstable. In contrast, a small
gain results in a small output response to a large input error, and a less responsive or less
sensitive controller. If the proportional gain is too low, the control action may be too small
when responding to system disturbances.

4.3 INTEGRAL
The integral term is proportional to both the magnitude of the error and the
duration of the error. The integral in a PID controller is the sum of the instantaneous error
over time and gives the accumulated offset that should have been corrected previously. The
accumulated error is then multiplied by the integral gain (Ki) and added to the controller
output. The integral term is given by:

The integral term accelerates the movement of the process towards setpoint and eliminates
the residual steady-state error that occurs with a pure proportional controller. However, since
the integral term responds to accumulated errors from the past, it can cause the present value
to overshoot the setpoint value

4.4 DERIVATIVE
The derivative of the process error is calculated by determining the slope of
the error over time and multiplying this rate of change by the derivative gain Kd. The
magnitude of the contribution of the derivative term to the overall control action is termed the
derivative gain, Kd. The derivative term is given by:

The derivative term slows the rate of change of the controller output. Derivative control
is used to reduce the magnitude of the overshoot produced by the integral component and
improve the combined controller-process stability. However, the derivative term slows
the transient response of the controller. Also, differentiation of a signal amplifies noise
and thus this term in the controller is highly sensitive to noise in the error term, and can
cause a process to become unstable if the noise and the derivative gain are sufficiently
large.

4.5 PID CONTROLLER


A proportionalintegralderivative controller (PID controller)
is a generic control loop feedback mechanism (controller) widely used in industrial
control systems a PID is the most commonly used feedback controller. A PID controller
calculates an "error" value as the difference between a measured process variable and a
desired setpoint. The controller attempts to minimize the error by adjusting the process
control inputs.
The PID controller calculation (algorithm) involves three separate
constant parameters, and is accordingly sometimes called three-term control: the
proportional, the integral and derivative values, denoted P, I, and D. Heuristically, these
values can be interpreted in terms of time: P depends on the present error, I on the
accumulation of past errors, and D is a prediction of future errors, based on current rate of

change. The weighted sum of these three actions is used to adjust the process via a control
element such as the position of a control valve, or the power supplied to a heating element.

Fig 4.1: block diagram of PID controller

The mathematical equation for the PID controller is given is:

u ( t ) =Kpep ( t ) + Ki ei ( T ) dT + Kd

ded ( t )
dt

In the absence of knowledge of the underlying process, a PID controller is the best controller.
By tuning the three parameters in the PID controller algorithm, the controller can provide
control action designed for specific process requirements. The response of the controller can
be described in terms of the responsiveness of the controller to an error, the degree to which
the controller overshoots the setpoint and the degree of system oscillation.
4.6 CONCLUSION:In this chapter various types of controllers are discussed and their
mathematical equations are also derived. The block diagram of PID controller is also
explained

CHAPTRE - 5

SPEED CONTROL OF DC MOTOR

5.1 INTRODUCTION
This chapter gives the information about the mathematical analysis of the MIT
rule, tuning of the PID controller and the modeling of the DC motor

5.2 MATHEMATICAL ANAYSIS:The idea behind the Model Reference Adaptive Control is to create a closed
loop controller with parameters that can be updated to change the response of the system to
match a desired model. There are many different methods for designing such a controller.
When designing an MRAC using the MIT rule, the designer chooses:
The reference model, the controller structure and the tuning gains for the
adjustment mechanism.

5.2.1 MIT rule:-

e y plant ymodel
MRAC begins by defining the tracking error, e. This is
simply the difference between the plant output and the reference model output.
Mathematically it is defined as:

Where

e = tracking error,
yplant = output of the plant
ymodel = output of the model

J ( )

1 2
e ( )
2

From this error a cost function of theta (J(theta)) can be formed. J is given as a

function of theta, with theta being the parameter that will be adapted inside the controller. The

choice of cost function will later determine how the parameters are updated. Below, a typical
cost function is taken.

To find out how to update the parameter theta, an equation needs to be formed for the change
in theta. If the goal is to minimize the cost related to error, it is sensible to move in the
direction of the negative gradient of J. The change in J is assumed to be proportional to the
change in theta. Thus, the derivative of theta is equal to the negative change in J. The result
for the cost function chosen above is given as:

d
J
e

e
dt

Negative change in theta is proportional to the negative change in gradient of J


This relationship between the change in theta and the cost function is known
as the MIT rule. The MIT rule is central to adaptive nature of the controller. Note the term
pointed out in the equation above labeled sensitivity derivative. This term is the partial
derivative of the error with respect to the theta. This determines how the parameter theta will
be updated. A controller may contain several different parameters that require updating. Some
may be acting on the input and the other may be acting on the output. The sensitivity
derivative would need to be calculated for each of these parameters. The choice above results
in all of the sensitive derivatives being multiplied by the error.

5.3 TUNING:Let us consider the plant transfer function as follows.

The equation for the PID controller is:

Where u(t)= input of the plant


kp = proportional constant
ki = integral constant
kd= derivative constant
uc = input to the controller
The transfer function of the closed loop plant along with the controller is given by:

The transfer function of the reference plant is given by:

The error is the difference between the plant output and the reference model output which is
defined mathematically as

Where e = error
y = output of the plant
ym = output of the model
The parameters of the controller which are to be tuned are

5.4 ADAPTIVE MECHANISM:The MIT rule is a gradient scheme that aims to minimize the squared error e2

The updated PID controller parameters

5.5 MODELLING OF DC MOTOR:A DC motor is an electric motor that runs on direct current (DC) electricity.
DC motors were used to run machinery, often eliminating the need for a local steam engine or
internal combustion engine. DC motors can operate directly from rechargeable batteries,
providing the motive power for the first electric vehicles. Today DC motors are still found in
applications as small as toys and disk drives, or in large sizes to operate steel rolling mills and
paper machines. Modern DC motors are nearly always operated in conjunction with power
electronic devices. Let us consider the DC motor as shown in figure.

Fig 5.1: DC motor


Consider the parameters of the DC motor as follows:
Ra = resistance of the armature circuit in ohms
La inductance of the armature circuit in henry

Va = input voltage in volts


Eb = back emf in volts
T = torque in N-m
If = field current in amperes
J = moment of inertia in
b = damping friction

5.5.1 Mathematical Analysis:For normal operation, the developed torque must be equal to the friction and the inertia. The
equation for the developed torque is given by:

The armature circuit,

The back emf is given by:

The torque developed by the motor is:

The various parameters and their values of the given DC motor is as follows.
Parameter
Armature Resistance
Armature Inductance
Back Emf Constant
Torque Constant
Moment of Inertia
Damping Friction

Symbol
Ra
La
Kb
Kt
J
B

Value
0.6
0.012H
0.8 Vs/rad
0.8 Vs/rad
0.0167 Kgm2/S2
0.0167 Kgm2/S

Table5.1 Parameters of DC motor

5.6 CONCLUSION
In this chapter MIT rule, tuning of the PID controller and the modeling of the
DC motor are discussed

CHAPTER - 6
SIMULATION AND RESULTS
6.1 INTRODUCTION
In this chapter the simulation diagram and results of the PID controller
using MRAC technique for the DC motor are shown and the different parameter
variations like kp, ki, kd are also shown.

6.2 SIMULATION DIAGRAM


. The simulation diagram for the Model Reference Adaptive Control PID
controller is as shown in the below figure.

Fig 6.1 :Simulation diagram of PID controller


6.3 RESULTS:For the square wave input the output of the MRAC PID controller is:

MRAC PID CONTROLLER FOR SQUARE INPUT


Plant output
Referene output

1.2
1

Amplitude

0.8
0.6
0.4
0.2
0
-0.2

50

100

150

200
TIME (Sec)

250

300

350

400

Fig 6.2 : Output of PID controller for square wave input

The variation of the different parameters (Kp, Ki, Kd) for the square wave input is given as:

Parameter variations of Square wave input

0.5

Kp

K
p

0
-0.5
-1
0

100

200

300

400

500

600

700

800

900 1000

K
i

Ki
-1

-2
5

0 100
-3
x 10

200

300

400

500

600

700

800

900 1000

K
d

Kd
0
-5

100

200

300

400

500 600
Time (sec)

700

800

Fig 6.3 :Output of various parameters(kp, ki, kd)

900 1000

The variation of different parameters for the sinusoidal input is given by:

MRAC PID Controller for Sinusoidal Input


Reference Output
Plant output

1
0.8
0.6

Amplitude

0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1

10

20

30

40

50
60
Time (Sec)

70

80

Fig 6.4 Out put of PID controller for sine wave input

90

100

The variation of different parameters for square wave input is given as:

Parameter variations for sinusoidal input

1
Kp

Kp
0
-1

10

20

30

40

50

60

70

80

90

100

Ki

Ki
-1
-2

10

20

30

40

50

60

70

80

90

100

-3

Kd

x 10

Kd

0
-5

10

20

30

40

50
60
Time (Sec)

70

80

90

100

Fig 6.5 Output of various parameters(kp, ki, kd)

6.4 CONCLUSION:In this chapter the simulation diagram and the results for various parameters
are shown.

CHAPTER 7
CONCLUSION

The automatic tuning of PID controllers has been investigated using


Model Reference Adaptive Control concepts and the MIT rule. Simple adaptation laws for the
controller parameters have been presented assuming that the process under control can be
approximated by a first order transfer function. The developed adaptation rules have been
applied to a first order system with a second order reference model. Furthermore, the
proposed technique has been applied to a simulated DC motor, which has non-linear
dynamics. The results obtained show the effectiveness of the technique. The resulting
performance could be improved by a better choice of the length of the adaptation period. The
MIT rule is known to have its disadvantages. First, the speed of adaptation depends on the
values of the command signal. This problem is often dealt with by using a normalized
adaptation rule. Second, the MIT rule does not guarantee the stability of the nominal system.
The Lyapunov approach can be used to provide guaranteed nominal stability. A further
limitation of the approach is the assumption of a structure for the nominal system. In this
paper a first order transfer function has been assumed, which could be too simple in many
applications. A more complex and flexible nominal model could be used, at the expense of
more complicated adaptation laws.
Improvement of speed and tracking error is done for the DC motor. Four
problems make the control position of the DC motor difficult; load changes, disturbances,
nonlinear friction and armature reaction. These problems are overcome by using the PID
controller using Model Reference Adaptive Control as simulated in the project.

You might also like