Content uploaded by Aleksei Tepljakov
Author content
All content in this area was uploaded by Aleksei Tepljakov on Apr 06, 2015
Content may be subject to copyright.
A Flexible MATLAB Tool for Optimal Fractional-order PID
Controller Design Subject to Specifications
TEPLJAKOV Aleksei1, PETLENKOV Eduard1, BELIKOV Juri1,2
1. Department of Computer Control, Tallinn University of Technology, Tallinn, Estonia
E-mail: aleksei.tepljakov@dcc.ttu.ee, eduard.petlenkov@dcc.ttu.ee
2. Institute of Cybernetics, Tallinn University of Technology, Tallinn, Estonia
E-mail: jbelikov@cc.ioc.ee
Abstract: In this paper, we present a flexible optimization tool suitable for fractional-order PID controller design with respect to
given design specifications. Fractional-order controllers are based on the rapidly evolving scientific field called fractional-order
calculus. Its concepts are applicable in solving many scientific and engineering problems, including robust control system design.
The fractional PID is a natural evolution of the conventional PID controller and as such new tuning strategies are now possible
due to enhanced accuracy of the fractional-order models. The presented tool, which is a part of FOMCON — a MATLAB
fractional-order calculus oriented toolbox, — uses numerical optimization methods to carry out the tuning and obtain a controller
for a chosen plant to be controlled, which can either be a fractional-order plant or an integer-order plant.
Key Words: fractional calculus, fractional pid, pid control, matlab toolbox
1 Introduction
Fractional-order calculus, being a topic of moderately ac-
tive discussion for some 300 years, presents novel mathe-
matical tools that are applicable, in particular, in the area of
system modeling and control, where new opportunities arise
that allow to enhance the system description accuracy and to
design robust controllers to improve the quality of the con-
trol loops.
Presently in the field of control system design there exist
several tools for working with fractional models and con-
trollers. Since issues exist in fractional models due to their
inherent complexity, these tools utilize the computational
power and flexibility of contemporary computing environ-
ments such as MATLAB to overcome these problems. No-
table examples include CRONE [1] and Ninteger [2] MAT-
LAB toolboxes.
A new MATLAB toolbox FOMCON [3] (“Fractional-
order Modeling and Control”) developed by the authors of
this paper and based on a mini toolbox FOTF [4–6] currently
aims at extending classical control schemes with concepts
derived from fractional-order calculus. In particular, a lot of
attention was given to developing a versatile fractional PID
design tool, based on numerical optimization algorithms. In
this paper, we present the resulting tool with relevant com-
ments on several implementation issues.
The paper is organized as follows. A brief introduction to
fractional modeling is provided in Section 2. The fractional
PID controller is also introduced in this section. Further, in
Section 3 the theoretical background forming the basis for
implementing the fractional PID controller optimization tool
is given. Toolbox description with additional implementa-
tion details follows in Section 4. An example of using the
tool for developing a controller for a linear plant is also pro-
vided. Some of the limitations of the current fractional PID
tuning facility realization are given in Section 5. Finally, in
Section 6 conclusions are drawn.
2 Brief Introduction to Fractional Control
In the following, a brief introduction to fractional calculus
in the context of modeling and control is provided.
2.1 Mathematical Background
Fractional-order calculus is a generalization of integration
and differentiation operations to the non-integer order oper-
ator aDα
t, where the lower and upper terminals of the oper-
ation are denoted by aand trespectively and αis the frac-
tional order such that
aDα
t=
dα
dtαℜ(α)>0,
1ℜ(α) = 0,
Rt
a(dt)−αℜ(α)<0,
(1)
where α∈R, but it can also be a complex number [5]. There
exist several definitions of the fractional differintegral. Con-
sider the Riemann-Liouville definition first [6]:
aDα
tf(t) =
1
Γ (m−α)d
dtmt
Z
a
f(τ)
(t−τ)α−m+1 dτ, (2)
for m−1< α < m, m ∈N, where Γ(·)is Euler’s gamma
function. Consider also the Gr¨unwald-Letnikov definition,
which is important due to its applications in numerical eval-
uation of fractional derivatives:
aDα
tf(t) = lim
h→0
1
hα
[t−a
h]
X
j=0
(−1)jα
jf(t−jh),(3)
where [·]denotes the integer part.
This work was partially supported by the Governmental funding project
no. SF0140113As08, the Estonian Science Foundation Grant no. 8738, and
the Estonian Doctoral School in Information and Communication Technol-
ogy.
The Laplace transform of an α-th derivative with α∈R+
of a signal f(t), relaxed at t= 0, and assuming zero initial
conditions is given by
LDαx(t)=sαF(s),(4)
where F(s)is obtained via the usual Laplace transform in-
tegral.
Thus, a fractional-order differential equation
anDαny(t) + an−1Dαn−1y(t) + ···+a0Dα0y(t) =
bmDβmu(t) + bm−1Dβm−1u(t) + ···+b0Dβ0u(t),(5)
where ak, bk∈Rcan be expressed as a fractional-order
transfer function in form
G(s) = bmsβm+bm−1sβm−1+···+b0sβ0
ansαn+an−1sαn−1+···+a0sα0.(6)
A system given by (6) is said to be of commenusrate order
if all the orders of the fractional operator sare integer mul-
tiples of some base order γsuch that αk, βk=kγ, where
γ∈R+,0< γ < 1. It should be noted, that the analysis of
commensurate order systems is facilitated.
For more information on fractional-order calculus the
reader is referred to the books [6–9].
2.2 Fractional-order PID Controller
PID controllers are ubiquitous in the industry [5]. In
process control more than 95% of the control loops are of
PI/PID type [10]. Thus the motivation for using the frac-
tional PID in industrial process control is evident. With a
more sophisticated controller, new design strategies are pos-
sible with respect to more flexible control loop design speci-
fications governing the controlled plant performance limita-
tions.
The fractional-order PID controller was first introduced
by Podlubny in [11,12]. This generalized controller is called
the PIλDµcontroller. It has a fractional integrator of order
λand a fractional differentiator of order µ, i.e. it can be
described by the following form:
Gc(s) = Kp+Ki
sλ+Kdsµ.(7)
Taking λ=µ= 1 a conventional integer-order PID
controller is obtained. With more freedom in tuning the
fractional-order controller the usual four-point PID diagram
can now be viewed as a PID controller plane, as illustrated
in Fig. 1.
Fig. 1: Fractional PID controller plane
In the following we discuss fractional-order PID con-
troller tuning and optimization and present the correspond-
ing MATLAB tool which is a part of the FOMCON toolbox.
3 Tuning and Optimization of the Fractional-
order PID controller
Over the years, several methods for tuning the fractional
PID controller have been proposed, e.g. [13, 14]. A compre-
hensive overview of tuning methods can be found in [15].
Due to an abundance of different types of plants, a general
tuning algorithm is desired. Since the fractional PID con-
troller has two more parameters to tune then given a suit-
able cost function, which describes the performance of the
control loop, the problem of finding a suitable set of PIλDµ
controller parameters is now five-dimensional. Clearly, this
makes analytic derivation of tuning rules more difficult. A
numerical optimization approach can be used, however. Be-
cause design specifications are to be considered, the problem
can be solved by constrained optimization.
There are several aspects to the problem of designing a
fractional-order PID controller using constrained optimiza-
tion:
•The type of plant to be controlled (integer-order or
fractional-order);
•Optimization criterion;
•Fractional PID design specifications;
•Specific parameters to optimize;
•Selecting initial parameters from the parameter space.
We consider time-domain simulation for the purpose of
optimization criterion evaluation. This implies that the simu-
lation can either rely on fractional-order methods or integer-
order methods. Because fractional-order simulation may be
slow and/or inefficient, it is more convenient to use well-
developed integer-order differential equation solving algo-
rithms instead. This, in turn, requires us to approximate the
fractional-order system and/or controller by an integer-order
system.
In terms of efficiency and accuracy, an appropriate ap-
proximation technique, based on frequency-domain fitting,
is the Oustaloup recursive filter approximation method [4,
16]. We briefly summarize it below.
The method is based on approximating a fractional-order
operator sγ, where 0< γ < 1, in a specified frequency
range ω= (ωb, ωh)and of order Nby a rational transfer
function obtained in the following manner:
sγ=K
N
Y
k=−N
s+ω′
k
s+ωk
,(8)
where the gain, respective poles and zeros are obtained by
using
ω′
k=ωb(ωr)
k+N+1
2(1−γ)
2N+1 ,
ωk=ωb(ωr)
k+N+1
2(1+γ)
2N+1 ,
K=ωγ
h, ωr=ωh
ωb
.
A modified Oustaloup method was proposed in [4, 6]. It
provides a better approximation result in the frequency range
of interest:
sγ=Gω
N
Y
k=−N
s+ω′
k
s+ωk
,(9)
where
Gω=dωh
bγ ds2+bωhs
d(1 −γ)s2+bωhs+dγ)!,
ωk=bωh
dγ+2k
2N+1
, ω′
k=dωb
bγ−2k
2N+1
,
and b > 0,d > 0. Good results can be achieved with b= 10,
d= 9, so the parameters are fixed at those values [4].
Due to the commutative property of the fractional operator
sα, an order α≥1can be approximated by
sα=snsγ,(10)
where n=α−γdenotes the integer part of αand sγis
obtained by the Oustaloup approximation using either (8) or
(9). It should be noted, that while the order of the obtained
filter in both cases is 2N+ 1, due to system interconnec-
tion the resulting order of approximation can be very high.
This restricts the usage of the method to computer-based so-
lutions.
Thus, by using the above approximations, the problem of
simulating fractional-order and integer-order systems mixed
structure is solved.
For fractional PID optimization one can simulate the re-
sponse of the typical negative feedback based control system
described by
Gcs(s) = Gc(s)G(s)
1 + Gc(s)G(s),(11)
where Gc(s)corresponds to the fractional PID controller in
(7) and G(s)is the plant to be controlled, which can be either
an integer-order approximation of a fractional-order plant,
or an integer-order plant, e.g. a first-order plus dead time
model.
Since time-domain analysis is utilized, it is natural to
choose a suitable performance index for optimization. Com-
monly used indicies are the following:
•integral square error ISE =Rt
0e2(t) dt,
•integral absolute error IAE =Rt
0e(t)dt,
•integral time-square error I T SE =Rt
0te2(t) dt,
•integral time-absolute error I T AE =Rt
0te(t)dt,
where e(t) = 1 −y(t),y(t)is the tuned fractional control
system closed-loop step response.
Design specifications can be considered as optimization
constraints. Typical specifications include the gain margin
Gmand phase margin ϕmwhich can be both derived from
the frequency-domain evaluation of the open-loop system in
the frequency range where the approximation is valid. Fol-
lowing the lines of [6] one can additionally choose the design
specifications listed below, taking advantage of the flexibil-
ity of the fractional controller achieved by considering the
frequency domain:
•High-frequency noise rejection: the constraint is ap-
plied to the complementary sensitivity function T(jω)
in the following way:
T(jω) = Gc(jω)G(jω)
1 + Gc(jω)G(jω)dB
≤AdB,(12)
∀ω≥ωtrad/s⇒ |T(jωt)|dB =AdB,
where Ais the desired noise attenuation for frequencies
ω > ωtrad/s.
•Output disturbance rejection: the constraint on the sen-
sitivity function S(jω)may be defined:
S(jω) = 1
1 + Gc(jω)G(jω)dB
≤BdB,(13)
∀ω≥ωsrad/s⇒ |S(jωs)|dB =BdB,
where Bis the desired value of sensitivity function for
frequencies ω≤ωsrad/s.
•Robustness to plant gain variations: a constraint is
formed such that
d arg(F(s))
dωω=ωcg
= 0,(14)
where F(s) = Gc(s)G(s)is the open-loop system, ωcg
is the critical frequency around which the phase of the
system must be flat.
Finally, a constraint on the fractional PID control effort
u(t)may also be considered.
The parameters to be optimized are obviously the PIλDµ
controller gains and non-integer integrator/differentiator or-
ders. So the optimized parameter set may be such that
θ=θgθǫ,(15)
θg=KpKiKd, θǫ=λ µ.
Therefore, three different possibilities exist in general:
•Optimize all parameters;
•Optimize gains only;
•Optimize orders only.
This also leads us to a possible way of obtaining the initial
parameters for optimization. It is possible, given sufficient
knowledge about the plant, to use classical integer-order PID
tuning methods to tune the gains, and then fine-tune the con-
troller by obtaining the integrator/differentiator orders.
4 Toolset Implementation in MATLAB
Based on all previous considerations, a toolset was devel-
oped for
•Obtaining parameters for an integer-order PID using
classical methods;
•Optimizing a set of fractional PID parameters subject
to given design specifications.
4.1 Tool Description
In FOMCON toolbox, the tools required to carry out the
aforementioned tasks are grouped inside a control module as
shown in Fig. 2.
Fig. 2: Fractional PID tuning tool hierarchy in FOMCON
toolbox (corresponding GUI name is given in parentheses)
The graphical user interface corresponding to the integer-
order PID tuning tool is depicted in Fig. 3. The workflow
is comprised of the following steps. First, a fractional-order
model, given by a fractional-order transfer function in (6) is
approximated by a classical, integer-order model (FOPDT,
IOPDT or IPDT) using optimization functions found in the
MATLAB Optimization toolbox. Next, a tuning rule is used
to compute the corresponding PID parameters. If these pa-
rameters are suitable, which can be immediately tested by
conducting a closed-loop simulation of the resulting control
system, they can be used as initial gain values for generalized
PID controller tuning via optimization.
The optimization tool GUI is depicted in Fig. 4. Hereafter,
we describe the features of the tool that were not previously
covered.
The Plant model panel determines the parameters used to
approximate a fractional-order plant. The same parameters
will be used for obtaining an approximation of the fractional
controller, also in case of an integer-order plant. The En-
able zero cancellation for non-proper LTI systems op-
tion invokes the isproper() function which ensures that
a proper system is obtained as a result of approximation and
system interconnection. Currently, the function will add a
pole s=−ωh, where ωhis the higher frequency bound of
approximation. This, obviously, is equivalent to adding a
low-pass filter in series with the control system, with a time
constant τ=1
ωh. As a consequence, the accuracy of simu-
lation will be reduced in that frequency region.
The Fractional PID controller parameters panel allows
to choose the optimized parameter set and change the initial
PIλDµcontroller parameters as well as parameter ranges. It
is important to note that by setting equal bounds of a param-
eter range will result in the removal of that parameter from
the optimization set. This applies to the optimize() func-
tion method. Thus, different types of controller (P, PIλ, PDµ,
PIλDµ) can be designed.
Optimization-specific parameters are found in the Opti-
mization and performance settings panel. Here, one can
choose the optimization algorithm. Currently two function
choices and four algorithms are provided:
•optimize(): Nelder-Mead algorithm. This uses a
special function [17] for optimization allowing for con-
strained optimization problems to be solved.
•fmincon(): interior-point algorithm, SQP algorithm
or active-set algorithm.
Fig. 3: Fractional-order model approximation based integer-
order PID tuning facility
Next, design specifications can be individually set. If en-
abled, the corresponding specifications will be evaluated and
constraints will be used for determining the feasibility of
the tuning parameter selection. For the gain and phase mar-
gin specifications it is possible either to request a minimum
value to be preserved throughout the optimization process
or to obtain a parameter set where these specifications are
fulfilled exactly.
Setting system simulation type and corresponding options
is possible in the Simulation parameters panel. Using
Simulink for simulation is also possible. This allows, in par-
ticular, to use the control effort saturation specification. In
order to use Simulink, one needs to check the Use Simulink
for system simulation option. Additionally, a different
model structure may be selected. This may be achieved by
creating a new model from the default one and editing it to
suit a particular task. This feature allows to obtain controller
parameters for nonlinear systems. Obviously, when a cus-
tom, nonlinear plant is used, the frequency-domain specifi-
cations no longer provide meaningful information about the
plant (unless the user provides a reliable linear approxima-
tion) so only performance index optimization should be con-
sidered.
Strict constraints can be requested when using the
optimize() algorithm. This will ensure that design spec-
ifications are always met, but will also require the feasibility
of the initial solution. Otherwise, an error will be issued.
When the Optimize button is pressed, the optimization
process begins. The optimization log will also be displayed
in the MATLAB console. It is possible to limit the number
of optimization iterations so one could for example assess
the effectiveness of the current optimization problem based
on convergence speed. After the optimization has finished, a
report will be generated if the corresponding option was set,
and if the optimization result is satisfactory, the parameters
of the controller can be copied into the fractional PID design
tool by pressing the Take values button.
Further, an example illustrating the use of the fractional
PID optimization tool is provided.
Fig. 4: Fractional PID optimization tool graphical user interface
4.2 Example
Consider a fractional-order system of a heating furnace
discussed in [11, 14]. It is described by the following
fractional-order transfer function:
G(s) = 1
14494s1.31 + 6009.5s0.97 + 1.69 .
We shall design a fractional-order controller for this plant
using the method described above.
First, a FOPDT model for this plant is obtained using the
iopid tune tool. The obtained model has the following
transfer function:
GF OP DT (s) = 0.58813
1 + 4766.83se−25.1528s.
Using the Ziegler-Nichols PID tuning formula, the
integer-order PID parameters are then obtained as Kp=
386.676, Ki= 50.3056, Kd= 12.5764. These gains were
then copied into the optimization tool and fixed, so that tun-
ing of only the orders of the fractional integrator and dif-
ferentiator could be performed. The refined Oustaloup fil-
ter was used for approximation with ω= [0.0001,10000]
rad/s, and order N= 5. Simulink was used for simulation
and the optimize() function was used for optimization.
The specifications were set for the gain and phase margins,
such that Gm≥10 dB, ϕm= 75◦. Also, the control sig-
nal value was limited to range ulim = [0; 750]. A maxi-
mum of 100 iterations was considered. The results of con-
troller parameter optimizations using different performance
metrics can be found in Table 1. Here, Ndenotes the num-
ber of iterations until optimization termination, ϕmdenotes
the phase margin, τdenotes the settling time and σdenotes
the overshoot. The best results were obtained with the ITSE
index and the corresponding control system step response
and open-loop frequency characteristics can be observed in
Fig. 5 and Fig. 6, respectively. It can be observed, that
by only tuning the orders of the PID controller integrating
and differentiating components, a better result was achieved
compared to the integer-order tuning.
0 2000 4000 6000 8000 10000
0
0.2
0.4
0.6
0.8
1
1.2
1.4
t [s]
Amplitude
Initial response
Post−optimization response
Fig. 5: Control system step response comparison
−150
−100
−50
0
50
100
Magnitude (dB)
10−4 10−2 100102104
−135
−90
−45
0
Phase (deg)
Bode Diagram
Frequency (rad/sec)
Initial frequency reponse
Post−optimization frequency response
Fig. 6: Control system open-loop frequency characteristics
comparison
Table 1: Fractional PID controller optimization results
Index λ µ N ϕm,◦τ, s σ, %
ISE 0.18751 0.43779 36 76.00 1203 12.3
IAE 0.10399 0.45757 50 77.86 1079 10.4
ITSE 0.01000 0.35526 45 79.32 1003 9.1
ITAE 0.11860 0.01071 100 77.36 1118 11.0
5 Discussion
The tools presented in this paper were developed in MAT-
LAB v. 7.10. The tools were previously tested in earlier
releases, i.e. 7.4-7.6 but not all current features may be sup-
ported in those versions. FOMCON requires Control System
toolbox for general functionality. Several features, also de-
scribed in this paper, require the Optimization toolbox.
In the current implementation of the presented toolset
there exist some limitations, a list of which can be found
below.
•Not all simulation options can be changed;
•When using Simulink with a custom nonlinear model,
frequency-domain specifications cannot, in general, be
applied;
•Approximating complex fractional-order systems may
lead to either a poor approximation or an error, thus
model simplification may need to be employed;
•The toproper() function may need a more sophis-
ticated algorithm to resolve the improper system prob-
lem;
•Analysis of the closed loop under noise and distur-
bances is not implemented.
These limitations will be dealt with in the upcoming ver-
sions of the toolbox.
6 Conclusions and Further Perspectives
In this paper, we presented a flexible MATLAB toolset
for fractional PID controller optimization. It is expected that
fractional modeling will soon be a standard practice, due to
benefits, stemming from the use of fractional calculus. Thus,
developing new techniques for fractional controller design is
essential, especially since the new fractional-order PID con-
troller can be considered as a natural evolution of the con-
ventional PID controller.
Further development of the proposed toolset can take sev-
eral directions, among which are:
•Developing a more general fractional controller design
tool, similar to sisotool of the Control System tool-
box;
•Implementing more optimization algorithms (e.g. ge-
netic algorithms based).
In the paper, we have shown that it is possible to use clas-
sic methods for integer-order PID design to obtain an initial
set of PID gains and then a huge improvement is introduced
by tuning the orders of the PID integral and differential com-
ponents. Usually it is possible to achieve a much better result
by optimizing all parameters of the controller. However, a
globally optimal solution is hard to guarantee. These issues
will also be the topic of further research.
References
[1] A. Oustaloup, P. Melchior, P. Lanusse, O. Cois, and F. Dan-
cla, “The CRONE toolbox for Matlab,” in Proc. IEEE Int.
Symp. Computer-Aided Control System Design CACSD 2000,
2000, pp. 190–195.
[2] D. Val´erio. (2005) Toolbox ninteger for
MatLab, v. 2.3. [Online]. Available:
http://web.ist.utl.pt/duarte.valerio/ninteger/ninteger.htm
[3] A. Tepljakov, E. Petlenkov, and J. Belikov, “FOMCON:
Fractional-order modeling and control toolbox for MAT-
LAB,” in Proc. 18th Int Mixed Design of Integrated Circuits
and Systems (MIXDES) Conference, 2011, pp. 684–689.
[4] D. Xue, Y. Chen, and D. P. Atherton, Linear Feedback Con-
trol: Analysis and Design with MATLAB (Advances in De-
sign and Control), 1st ed. Philadelphia, PA, USA: Society
for Industrial and Applied Mathematics, 2008.
[5] Y. Q. Chen, I. Petras, and D. Xue, “Fractional order control -
a tutorial,” in Proc. ACC ’09. American Control Conference,
2009, pp. 1397–1411.
[6] C. A. Monje, Y. Chen, B. Vinagre, D. Xue, and V. Feliu,
Fractional-order Systems and Controls: Fundamentals and
Applications, ser. Advances in Industrial Control. Springer
Verlag, 2010.
[7] K. Miller and B. Ross, An introduction to the fractional cal-
culus and fractional differential equations. Wiley, 1993.
[8] I. Podlubny, Fractional differential equations, ser. Mathemat-
ics in science and engineering. Academic Press, 1999.
[9] A. A. Kilbas, H. M. Srivastava, and J. J. Trujillo, Theory
and Applications of Fractional Differential Equations, Vol-
ume 204 (North-Holland Mathematics Studies). New York,
NY, USA: Elsevier Science Inc., 2006.
[10] K. ˚
Astr¨om and T. H¨agglund, Advanced PID control. The
Instrumentation, Systems, and Automation Society (ISA),
2006.
[11] I. Podlubny, L. Dorcak, and I. Kostial, “On fractional
derivatives, fractional-order dynamic systems and PIλDµ-
controllers,” in Proc. 36th IEEE Conf. Decision and Control,
vol. 5, 1997, pp. 4985–4990.
[12] I. Podlubny, “Fractional-order systems and PIλDµ-
controllers,” IEEE Trans. Autom. Control, vol. 44, no. 1, pp.
208–214, 1999.
[13] D. Xue and Y. Chen, “A comparative introduction of four
fractional order controllers,” in Proceedings of the 4th World
Congress on Intelligent Control and Automation, 2002, pp.
3228–3235.
[14] C. Zhao, D. Xue, and Y. Chen, “A fractional order pid tun-
ing algorithm for a class of fractional order plants,” in Proc.
IEEE Int Mechatronics and Automation Conf, vol. 1, 2005,
pp. 216–221.
[15] C. Monje, B. Vinagre, V. Feliu, and Y. Chen, “Tuning and
auto-tuning of fractional order controllers for industry appli-
cations,” Control Engineering Practice, vol. 16, no. 7, pp.
798–812, 2008.
[16] A. Oustaloup, F. Levron, B. Mathieu, and F. M. Nanot,
“Frequency-band complex noninteger differentiator: charac-
terization and synthesis,” IEEE Trans. Circuits Syst. I, vol. 47,
no. 1, pp. 25–39, 2000.
[17] R. Oldenhuis. (2009) Optimize. Math-
Works File Exchange. [Online]. Available:
http://www.mathworks.com/matlabcentral/fileexchange/24298-
optimize