problema4 sbic tiago helena
TRANSCRIPT
-
7/31/2019 Problema4 SBIC Tiago Helena
1/7
Second order system with different controllersTiago Filipe Carvalho Rodrigues; Helena Isabel Pais Ferreira de Vargas
Students of the Faculty of Engineering of Porto University, Department of Electrotecnical Engineering
[email protected]; [email protected]
Abstract - This paper describes the operation controllers appliedto a system of second order, starting with the application ofconventional controllers and passing to the use of fuzzycontrollers. At the end there will be a comparison with dataobtained through the implementation of controllers, using asimulator from MatLab called Simulink.
I. INTRODUCTIONIn industry, controllers are widely used nowadays, and are
responsible for industrial process control, using for that
classical PID controllers, fuzzy controllers or even neural
networks.
This paper addresses the classical PID controllers as well
as its design and calculation of earnings for its
implementation, and also the fuzzy controllers (as well as
your project, the membership functions, inference rules, etc),
both applied to a same system of second order.
Well talk about the operation of each of the controlle rs,
explain how they were design, compare the performance
obtained with each one of the controllers and after that, test
the performance of controllers applied to dynamic systems,
ranging from system reference and parametric variation of the
system.
II. CLASSICAL PIDThe classical PID (Proportional, Integral, Derivative), is the
most common and used controller in the industry control
systems, calculating an error value, making the difference
between a measured process variable and a desired set point.
The PID controller will try to minimize the error by
adjusting the process control inputs, by his mathematic
formulation
(1)
On (1), Kp is the proportional gain, which will act on the
present error, reducing the overshoot of the system response.
On (1), Ki is the integral gain, which will act based on the
accumulation of past errors, accelerating the movement
process for the desired set point, also eliminating steady state
error.
On (1), Kd is the derivative gain, which will act base on the
current rate change of errors, giving the possibility to control
the rising time, that is the time that the system takes to reach
the steady state.
The gains of the PID controller, give the option to select
the weighting of each action in the final value of the
controller in order to obtain the best possible performance of
the system.
III. PROJECTING A PIDCONTROLLERFirst we need to analyze the transfer function of the system
that we want to stabilize with a PID controller.
(2)
As we can see, this system (2) will be unstable, because
despite having a pole in the Left Semi Plan (pole at -1), also
has a pole at the origin, which will confer instability to the
system.
We can observe this instability in the open loop response of
the system.
Fig.1 System Response in open loop
As we can see in Fig. 1, the system response evolves
continuously to infinity, never reaching a set point required
for steady state.
Besides the system response in open-loop, we can also
observe the Root Locus to determine the stability of the
system.
-
7/31/2019 Problema4 SBIC Tiago Helena
2/7
-
7/31/2019 Problema4 SBIC Tiago Helena
3/7
The poles of this system will be in -0,108; -0,287 and
-5,604, matching with the poles shown in Fig.4, and proving
that the system is stable now with all poles on the semi left
half plan.
To see the impulse response of the system, to check the
stability of the system, we did a simulation of the system with
the help of application Simulinc of the software MatLab.
Fig.5 Impulse response of (4)
We can verify that the system response is stable, having no
steady state error, but with some initial small overshot and
relatively slow in reaching the steady state operation.
This shows how effective it is a classic PID controller, in
the use of process control, along with its relative ease of
design and implementation, explains why the classic PID
controller is one of the more widely used controllers in the
entire industry.
IV. FUZZY CONTROLLERSIn the projection of classical PID controllers, attention is
given to system modeling by differential equations,
representing itself, and construct a mathematical controller
that can put the poles of the most advantageous way possible,
for stability and best performance.
In fuzzy logic controllers the logic is the opposite, attention
is given in the intuitive understanding of the system and how
it well be the best way to control the system.
For example, if one person needs to control the watertemperature of a shower, he intuitively follows rules which
allow him to regulate the water temperature, for example:
If temperature is low then increase temperature;
If temperature is pleasant then keep temperature;
If temperature is high then lower temperature;
These rules are formed with the help of a good
understanding of the functioning of the system, in this case
the system was easy to understand, in some complexes cases,
to build a set of rules that allow us to control a system is
difficult.
A fuzzy controller operates similarly, contains four main
components, which are the following:
1 A system of rules, which contains the knowledge to
control the system as best as possible
2 An inference engine, that decides which rules control
are relevant to the current state of the system, and then decidewhich input would be best for the system
3A system of fuzzification, which modifies the inputs of
the controller in order so that he could interpret and compare
with the system of rules
4A system of defuzzification, which converts the values,
determined by the inference system in the system outputs to
control
Fig.6 Fuzzy controller architecture
One of the greatest advantage of the fuzzy controllers, are
the membership functions used by the inference engine,
because instead of having only two logical values (true or
false/ 1 or 0), the membership functions in fuzzy controllers
are prepared to deal with partial truths, allowing intermediatevalues, unlike crisp functions.
The membership functions of the example given above
could be something like Fig.6.
Fig.7 Membership Functions
In Fig.7, cold, warm and hot are representative of the
variable temperature, represented by membership functions,
where they say the temperature range that each variable has.
One point in this membership function has real meanings, a
true value for each variable.
The vertical line present in Fig.7 contains three arrows that
indicate the true values for each variable.
Since the red arrow is pointing to zero, it means that the
temperature is not hot. The orange arrow points to a value
-
7/31/2019 Problema4 SBIC Tiago Helena
4/7
that will be around 0.2 may be interpreted as slightly warm
and the blue arrow that points to a value that will be around
0.8 may be interpreted as quite cold.
This membership function, along with a set of intuitive
rules, such as those shown above, would form a fuzzy
controller capable of controlling the water temperature,
knowing what temperature should be chosen in each moment
of operation of the system.Basically, the fuzzy controllers should be viewed as an
artificial intelligence that makes decisions in real time, on
how to control a system. Gather information about the system
output compares it to a given reference and then decide what
should be the input value of the system to ensure the desired
performance.
V. DESIGN OF A FUZZY CONTROLLERThe fuzzy controller will be design to control (2).
The design of a fuzzy controller is based on three basic
components, which are the following:1Choose the inputs and outputs of the fuzzy controller
2Choose the membership functions, used in the inference
mechanism for the input value, and also the membership
functions used in the construction of the inference of the
controller outputs
3 Choose the fuzzification and defuzzification methods,
the methods for the inference mechanisms and the system
control rules
Our objective is to design a PID fuzzy controller type, so to
the inputs we decide to choose the following inputs:
- error- error change- error accelerationThe error is the difference between the output and the input
therefore is considered to be the proportional input. The
variation of the error is given by the derivative of the error, so
it is considered the derivative input and the acceleration of the
error is given by the integral of the error, being the integral
input of the fuzzy controller.
We will just have one controller output, because the
purpose is only to correct the errors that may exist in the
system in relation to the desired set point for steady state
function.
After choosing the inputs and outputs, is time to choose the
membership functions for the three inputs and also for the
output of the controller.
Fortunately the system (2), that we have to control it
doesnt have such a complexity which requires us to have
very complex membership functions, with many variables.
For that reason we create one type of membership function,
common between the three inputs, relatively simple with only
three variables, which are defined by Negative, Zero and
Positive, being every one of the variables of the triangular
type.
For the output, we decided to create five variables, which
are defined by LargeNegative, SmallNegatve, Zero,
SmallPositive and LargePositive, being every one of the
variables of the singleton type.
Since the system input (reference) is a step of unitary
value, the system error will always be the difference betweenthe value of the step and the output of the system, giving the
possibility to predict what values should be the errors, and
what values should be defined the membership functions and
therefore have been chosen the range of values for the inputs
and output of the system between -2 and 2, already giving
some margin of error for the error get away from the desired
set point.
Fig.8 Membership Functions of the inputs
In Fig.8 we can see membership function, which is equal to
the three inputs to the system previously chosen.
Fig.9 Membership Functions of the output
In Fig.9 we can see the membership function chosen for the
output of the fuzzy controller.
After the choice of Inputs/Outputs system and their
membership functions, and explained the reasons for their
choices, it becomes necessary to discuss the methods of
fuzzification, defuzzification, rules chosen for the system and
methods of the inference mechanism.
The Model chosen for the fuzzy PID controller was the
Mamdani Model, which the Linguistic prototype is:
IF the error is positive AND the error change is zero AND
the error acceleration is zero THEN the output change is
zero.
-
7/31/2019 Problema4 SBIC Tiago Helena
5/7
After verifying the model used in the fuzzy controller, it is
important check the rules chosen to control the system. It was
only needed nine rules to control (2). The rules we used were
this:
- If (E is Negative) and (CE is Negative) and (CCE is
Negative) then (u is LargeNegative)
- If (E is Negative) and (CE is Zero) and (CCE is Zero)
then (u is SmallNegative)- If (E is Negative) and (CE is Positive) and (CCE is
Positive) then (u is Zero)
- If (E is Zero) and (CE is Negative) and (CCE is Negative)
then (u is SmallNegative)
- If (E is Zero) and (CE is Zero) and (CCE is Zero) then (u
is Zero)
- If (E is Zero) and (CE is Positive) and (CCE is Positive)
then (u is SmallPositive)
- If (E is Positive) and (CE is Negative) and (CCE is
Negative) then (u is Zero)
- If (E is Positive) and (CE is Zero) and (CCE is Zero) then
(u is SmallPositive)
- If (E is Positive) and (CE is Positive) and (CCE is
Positive) then (u is LargePositive)
The surface resultant of these rules is in Fig.10.
Fig.10 Surface of the rules for PID controller
In this case, with the use of only nine rules was possible to
control (2) with a good performance, even better than
previously obtained with the classical PID controller.If this set of rules couldnt bring stability to the system, or
if it was necessary to increase the system performance, we
could from each existing rule create three new rules, which
would be made with the change of CCE for each of nine
existing rules leaving a total of twenty seven rules. The more
rules a system has, more knowledge will have to make
decisions in the control system.
To evaluate the firing level of each rule, is used the
operator AND ( ), where it is utilized the
product operator.
After the evaluation of the firing level of each rule, it
evaluates the output of each rule, where the value obtained
with the product operator determines the value of the output,
which is going to have the value of the product, because we
are using singletons on the output.
If we werent using singletons, the output would be like
shown in Fig.11.
Fig.11 Operator AND with the product method
After realizing how the rules and the fire level of each rule
is obtained, it is important to discuss the method of
aggregation of the results for multiples rules, to obtain a
single output in the fuzzy controller.
In our case is used only one rule at a time to control the
system, but diffuse controllers allow the use of multiple rules
for a given time, allowing a more complete control of the
system.
To obtain the aggregation result, are used operators such as
sum, maximum or probabilistic sum.
Finally, after the fuzzy set obtained with the aggregation
operation, it is necessary to do the defuzzification of the
fuzzy set, to transform the actual value of the fuzzy set in a
real value which can be applied to the control the system.
Various methods are used to do this, the most common
choice falls on the Centre of Gravity, which was the method
we choose to use on this paper, but there are other methodsthat can be used, such as Centre of Sums, Mean of Maximum,
etc.
Fig.12 Defuzzification with Centre of Gravity method, for
discrete and continues time
After having designed the fuzzy controller of the type PID,
we pass to the simulation of the system with the fuzzy
controller, with the help of application Simulinc of the
software MatLab, so we can see the impulse response of the
system.
-
7/31/2019 Problema4 SBIC Tiago Helena
6/7
Fig.13 Impulse response of the System with fuzzy
controller
As can be seen in Fig.13, the system response is stable,
without any overshoot, reaches the steady state operation in a
short time and does not have any errors in continuous
operation, and so we can consider that the system has a good
performance.
By comparison with the classic PID controller, we can seethat it reaches the steady state operation almost four times
faster and without any overshoot, in other words, has a much
better performance than the classic PID controller. If we
increase the number of the rules as suggested above, the
performance observed in the impulse response would be even
better.
Once designed the fuzzy controller of the type PID, we
thought that it would be interesting to try other configurations
with fuzzy controllers such as PD, PD + integrator, PD + PI,
and found that the configuration that the configuration which
best fit to our system to control was the configuration PD +
integrator.
Fig.14 Impulse response of the System with fuzzy
controller
As we can verify, the system is stable, without any error in
steady state operation and it doesnt have overshoot, as we
have seen already in the fuzzy controller of type PID, but has
a better performance, because it can achieve steady state
operation in almost half the time of the PID fuzzy controller
and almost eight times faster than the classic PID controller.
VI. TESTING THE CONTROLLERS WITH REFERENCE ANDPARAMETRIC VARIATION
For this kind of comparison, we could use all controllers
designed in this paper, but this is unnecessary because the
objective of this paper is to compare the performance of the
conventional PID controllers with the fuzzy controllers.
In this case it is sufficient to compare the classic PIDcontroller with the fuzzy controller that has the better
performance with the system under consideration in (2), in
other words, the fuzzy controller PD + integrator.
Fig.15 Impulse response with a Classic PID controller with
reference change
Fig.16 Impulse response with a PD+I fuzzy controller with
reference change
As we can verify through Fig.15 and Fig.16, when the
system is exposed to variations in the reference, the classic
PID controller can reach the new reference given to the
system, but it takes time to reach steady state operation of the
new reference, besides the existent overshoot on the
transition.
In the opposite side we have the fuzzy controller with thePD + integrator configuration, which when exposed to a
change of reference, have a rapid transition to the steady state
operation of the new reference without the occurrence of
overshoot.
In Fig.17 and Fig.18 we can see the behavior of the
controllers when a system changes during the operation, in
other words, there are parametric variations in the model
adopted for designing the controller.
-
7/31/2019 Problema4 SBIC Tiago Helena
7/7
Fig.17 Impulse response with a Classic PID controller with
parametric change
Fig.18 Impulse response with a PD+I fuzzy controller with
parametric change
As we can see, when the system change during operation,
in other words, when there are parametric variations of the
model used to design the controllers, in this case there isnt an
optimal controller, but may instead be a compromise between
different purposes. In this case we can see that the classic PID
controller can have a lower overshoot when the system
change, but at the same time takes much time to reach again
the steady state operation, while the fuzzy controller has a
response to the parametric variation with a greater overshoot
than the classical controller, but reaches the steady state
operation more quickly.
In summary, in this case the choice of the best controller
would depend on the target, if the target is to have a faster
response to variations of the system, the fuzzy controller
would be best, but if the aim is to have a low overshoot in
response to parametric variations, the best controller would
be the classic.
VII. CONCLUSION
At the end of this paper we make an overview of what we
can learn from the comparison of classical PID controllers
with fuzzy controllers.
The classical PID controller is the most popular and used in
industry, in general achieve good results in practically all
applications and is also easy to implement and tuning.
Besides the classic PID controller turns out to be standardized
by its mathematical equation, which is applicable in all cases,
and for tuning the process controller for each individual
process, simply changing the gain, and can be guide by the
study of the root locus of each process, in other words, it has
a more rigorous design and not dependent of the designer
knowledge about the operation of the system to be controlled.
The fuzzy logic controllers, usual have good performances
in control of systems, but they depend on the level ofknowledge about the operation of the system by the designer,
in a manner that the controller can built a set of rules and
inference mechanism suitable for each system, to obtain the
best performance possible.
We can say that this paper does not fully exploit all the
capabilities allowed by fuzzy controllers, since the infinite
ability to create multiple input variables, as well as the
membership functions that can be created, to the various
options for inference mechanisms, the possibility of using
multiple rules in one given moment, and even different ways
of calculating a real value from a fuzzy set, to be placed at the
input of the control system.
It is also important to say that there are more types of
controllers than those explored in this paper, and in the future
we can explore the possibility to integrate different
controllers to control the same system.
REFERENCES
M.PASSINO,KEVIN;FUZZYCONTROL