# Control

## 1  Fractional control actions

### 1.1  Time domain

In the following, we illustrate the effects of the basic fractional-order control actions in the time domain [1]. For this we consider the response of the system

$$C(s) = K\cdot s^{\alpha}, \tag{1}$$

where $K$ is the gain of the differentiator/integrator of order $\alpha$, such that $-1\leqslant \alpha \leqslant 1$.

In the following figure the response of a fractional-order integrator to a square input signal is shown.

Figure 1. Response of a fractional integrator to a square signal

In Figure 2 it is possible to observe the response of a fractional-order differentiator to a trapezoidal input signal.

Figure 2. Response of a fractional differentiator to a trapezoidal signal

### 1.2  Frequency domain

For the fractional-order components the following is achieved by varying the value of $\alpha$ in the range $\alpha\in[-1, 0]$ for the fractional-order integrator and in the range $\alpha\in[0, 1]$ for the fractional-order differentiator it is possible to achieve the following:

• A constant increment in the slope of the magnitude curve that is $20\alpha$ dB/dec.
• A constant delay in the phase plot that is $({\pi}/{2})\alpha$.

It can be seen, that in both the time domain and in the frequency domain additional flexibility of the control actions is introduced. Based on this it is possible to design robust fractional-order controllers.

## 2  Fractional controllers

In this section, we introduce two fractional-order controllers which are derived from classical controllers by means of generalization of the integral and differential components.

### 2.1  Fractional PID controller

The fractional PID controller was introduced by Podlubny [2]. The controller is called the PI$^{\lambda}$D$^{\mu}$ controller1 since it has an integrator of order $\lambda$ and a differentiator of order $\mu$. It has been confirmed, that this type of controller offers superior performance compared to the classical PID controller [1, 3, 4].

The control action of the parallel form PI$^{\lambda}$D$^{\mu}$ controller can be expressed in the time domain as follows:

$$u(t) = K_p e(t) + K_i \mathscr{D}^{-\lambda} e(t) + K_d \mathscr{D}^{\mu} e(t), \tag{2}$$

where $e(t)$ is the error signal. In the Laplace domain, assuming zero initial conditions, the fractional-order PID controller has the following form:

$$C(s) = K_p + \frac{K_i}{s^{\lambda}} + K_d s^{\mu}. \tag{3}$$

The case $\lambda=\mu=1$ corresponds to the classical, integer-order PID controller. In Figure 3 a comparison of the frequency domain characteristics of such a controller to those of the fractional PID controller with integrator/differentiator orders of $\lambda=\mu=0.5$ is shown.

Figure 3. Bode diagram: PID controller vs. PI$^{\lambda}$D$^{\mu}$ controller with $K_{p}=K_{i}=K_{d}=1$ and $\lambda=\mu=0.5$

Lead-lag compensators are a well-known type of feedback controller that is widely used in practice. A fractional-order lead-lag compensator has the following transfer function [1]:

$$C(s)=K_{c}x^{\alpha}\left(\frac{\lambda s+1}{x\lambda s+1}\right)^{\alpha},\quad 0 \lt x \lt 1, \tag{4}$$

where $\alpha$ is the fractional power, $1/\lambda=\omega_{z}$ and $1/(x\lambda)=\omega_{p}$ are the zero and pole frequencies, respectively, when $\alpha \gt 0$. Two cases are possible:

• $\alpha \gt 0$: the controller in (4) corresponds to a fractional-order lead compensator, whose behavior is similar to that of a PD$^{\mu}$ controller;
• $\alpha \lt 0$: the controller in (4) corresponds to a fractional-order lag compensator, whose behavior is similar to that of a PI$^{\lambda}$ controller.

A survey of tuning methods for both PI$^{\lambda}$D$^{\mu}$ controllers and fractional lead-lag compensators can be found in [1, 5]. Additionally, methods suitable for practical implementations of fractional-order controllers are provided in e.g. [6, 7].

Other fractional-order control techniques are elaborated upon. Once they become relevant to the FOMCON project, a summary will be included on this page.

## References

 [1] 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. [2] I. Podlubny, “Fractional-order systems and PI$^{\lambda}$D$^{\mu}$-controllers,” IEEE Transactions on Automatic Control, vol. 44, no. 1, pp. 208–214, 1999. [3] M. Čech and M. Schlegel, “The fractional-order PID controller outperforms the classical one,” in Process control 2006. Pardubice Technical University, 2006, pp. 1–6. [4] Y. Luo and Y. Chen, “Fractional-order [proportional derivative] controller for robust motion control: Tuning procedure and validation,” in Proc. ACC ’09. American Control Conference, 2009, pp. 1412–1417. [5] C. Monje, B. Vinagre, V. Feliu, and Y. Chen, “Tuning and auto-tuning of fractional order controllers for industry applications,” Control Engineering Practice, vol. 16, no. 7, pp. 798–812, 2008. [6] Y. Q. Chen, I. Petráš, and D. Xue, “Fractional order control – A tutorial,” in Proc. ACC ’09. American Control Conference, 2009, pp. 1397–1411. [7] I. Petráš, “Practical Aspects of Tuning and Implementation of Fractional-Order Controllers,” ASME Conference Proceedings, vol. 2011, no. 54808, pp. 75–84, 2011.

• 1 Notation PI$^{\lambda}$D$^{\delta}$ is also used

Posted January 6, 2013 at 06:57 | Permalink

hi
i cant speak english vary well…sorry
i have some question
what is the frequency range?
how define that for my system?
i have a switching system…for example switching frequency is 15kHZ
now my frequency range must be [0.01 20000] ?
thank you

2. aa
Posted May 2, 2014 at 10:32 | Permalink

Do you know how it able to obtain cfehigh and cfelow?
Can you help me?

3. Partha Roy
Posted May 18, 2014 at 15:18 | Permalink

I would like to simulate the fractional order systems. Please help clarifying the step by step procedure.
Thank you.

• Posted May 18, 2014 at 18:50 | Permalink

The procedure in FOMCON/MATLAB is the same as for integer order systems. There are lots of examples on how to do this.

4. Mohamed
Posted June 12, 2014 at 22:49 | Permalink

Hello,

I want to know if the embedded coder toolbox in MATLAB suuports FOMCON blocksets or not? I want to implement a TID control on a microcontroller, is it feasible using your toolbox?

• Posted June 13, 2014 at 07:53 | Permalink

Dear Mohamed,
It may be possible, but since I do not use Embedded Coder, it is hard for me to comment on it.

5. Reza
Posted November 2, 2014 at 22:52 | Permalink

Dear Aleksei
Thanks for your excellent Toolbox. it’s very good.
i use with Matlab R2009a and now i want to use Simulink. but i can’t call it. how can i call them?

• Posted November 3, 2014 at 09:33 | Permalink

I’m afraid that the Simulink library for the current release may not work in R2009a. Type fod in MATLAB, see if you get any result.

• Hariom
Posted October 7, 2015 at 09:35 | Permalink

i use with Matlab R2009b/R2008b and i want to use Simulink. but i can’t call it. If I use fod in Matlab, I have following error.
Undefined function or variable ‘fod’.

6. Reza
Posted November 3, 2014 at 11:42 | Permalink

I found it and now i’m working them. it seems they work.
it’s good!

7. Reza
Posted November 6, 2014 at 14:38 | Permalink

Dear Colleague
This toolbox used only for LTI or it used for non linear control, too?

• Posted November 6, 2014 at 15:12 | Permalink

You can certainly use the toolbox for identification & control of nonlinear systems in particular working points (that is, using linear approximations).

8. Reza
Posted November 6, 2014 at 15:17 | Permalink

very good.
Thanks a lot.

9. Reza
Posted November 17, 2014 at 14:12 | Permalink

Dear Colleague
I want to design a self-tuning fractional orde PID controller. following as :
http://www.uplooder.net/cgi-bin/dl.cgi?key=8f07791216d0cf155b3134fae6878664

Assume i ‘m tuning coefficients of FOPID with an Algoritm. (Kp, Ki, Kd, lambda, mu).
now how i can consider lambda and mu in my design?

Best Regards,
Reza

10. Reza
Posted November 17, 2014 at 19:16 | Permalink

Dear Professor
but my problem is in matlab.
i don’t know how i must allocate the value of mu and lambda to their!

• Posted November 18, 2014 at 17:48 | Permalink

Kindly elaborate. What do you mean by “allocate the value of mu and lambda to their”? Why is this a MATLAB problem?

11. Reza
Posted November 18, 2014 at 19:31 | Permalink

According to the file i have sent you in my last comments,
the parameter of lambda that related to the order of integrator is obtained by an Algorithm.
Now, how should i connect Lambda to the integrator block to be able to change order of s ? it means should be replaced the order of s with the amount of lambda?

12. Reza
Posted November 19, 2014 at 21:39 | Permalink

I understood how it does work!
Is my sentence correct?
” The enter of integrator blok is Lambda”. As follows:
http://www.uplooder.net/img/image/87/577254f5a2a1500abcd03080674d2cb9/integrator.jpg
Is it right?

• Posted November 20, 2014 at 16:37 | Permalink

Ok, I think I understand.
No, this is not the way things work. The order cannot be set in the manner you describe.
You can, however, set it via MATLAB code by means of set command.

13. Reza
Posted November 20, 2014 at 18:32 | Permalink

I don’t want to use Matlab code. so it means that, in simulink, we can not self tuning for Fractional PID controller?
for example can you design a fractional PI controller in matlab simulink with self tuning?
Is it possible?

14. Reza
Posted November 20, 2014 at 22:39 | Permalink

Excuse me,
the lambda and mu values in the fractional PID should never be the “1” ?
There is not a special way to become Cnventional PID?
this code does not work :
Kp=10 ; Ki=20 ; Kd=30 ; lambda=1 ; mu=1;
Gc=fracpid(Kp, Ki, lambda, Kd, mu)
step(Gc)

• Posted November 21, 2014 at 07:28 | Permalink

You cannot simulate systems with more zeros than poles. This is due to the differential component.
But try this: t=0:0.01:100; plot(t,step(Gc,t));
You can actually simulate such systems using the GL definition-based solver. The simple command step is overloaded in FOMCON in such a way that uses the one in Control System toolbox, which cannot simulate it.

• Reza
Posted November 21, 2014 at 09:53 | Permalink

Thanks Dear professor,
I understood what you said.
What is GL ??
Can you take an example that how do you design a PI contrller with self-tuning?
it does not matter with simulink or script!
I only want to see your manner that how do you change lambda.
I think it is a bug in simulink!

Best Regards,

15. Reza
Posted November 21, 2014 at 11:21 | Permalink

If the simulink block work as follows, that was good :
the lambda and mu of parameters and ki, kp, kd obtained with fuzzy.

Is it possible that i send my simulation for you and comment about it? (by email)

16. tanoli
Posted December 11, 2014 at 09:11 | Permalink

hi, please tell me how to tune FOPID controller , ? and what are K,L and T in zntune,

17. Reza
Posted December 13, 2014 at 23:38 | Permalink

Dear professor,
does not work fractional functions in Embeded Matlab Function Block??
It seems that these are not support by Embeded Matlab!!!
for example i wrote this code in Embeded Matlab Function :
———————–
function Gc = fracpid(kp, ki, lambda , kd, mu)
fotf(‘s’)
Gc=fracpid(kp, ki, lambda , kd, mu)
———————–
but it doesn’t work!
Is it right?

18. Reza
Posted January 15, 2015 at 20:49 | Permalink

Dear professor,
If you mind answering my question?
does not work fractional functions in Embeded Matlab Function Block??
It seems that these are not support by Embeded Matlab!!!
for example i wrote this code in Embeded Matlab Function :
———————–
function Gc = fracpid(kp, ki, lambda , kd, mu)
fotf(‘s’)
Gc=fracpid(kp, ki, lambda , kd, mu)
———————–
but it doesn’t work!
Is it right?

• Posted January 16, 2015 at 10:52 | Permalink

Embedded MATLAB relies on a limited set of core language features. FOMCON is not supported.

19. Reza
Posted January 25, 2015 at 11:34 | Permalink

Dear professor,

I want to change parameter of “lambda” in Fractional integrator block by “set_param” command.
but it has a Error as follows :
??? Error using ==>
Fractional integrator block (mask) does not have a parameter named ‘Integration order’.

Where is the problem?

20. Reza
Posted January 27, 2015 at 21:55 | Permalink

but it isn’t different!
the name of block diagram is “Fractional integrator” and the name of parameter that i want to change is “Integration order”. the Matlab Code is :
set_param(‘FOPID/Fractional integrator’,’Integration order’,’.5′)
http://www.uplooder.net/cgi-bin/dl.cgi?key=d792c70c6254298fc2cd7266007fab6d

Best Regards,
Reza

• Posted January 28, 2015 at 13:27 | Permalink

If you are using the FOMCON Simulink library, then for the continuous-time FOPID controller, assuming that the model is named “testm.mdl” and the controller inside of it is called “FOPID”, you would use the following command to set the integration order:
set_param('testm/FOPID','Ki','.5')

21. Reza
Posted January 28, 2015 at 18:54 | Permalink

Yes I’m using the FOMCON Simulink library.
I think it isn’t right. the parameter that want to change is “Integration order” not ” Ki”.
Fractional integrator block (mask) does not have a parameter named ‘Ki’.

but also, Fractional integrator block (mask) does not know parameter named ‘Integration order’.

• Posted January 29, 2015 at 07:34 | Permalink

Do this: set_param('FOPID/Fractional integrator','gam','.5')

22. Reza
Posted January 29, 2015 at 10:19 | Permalink

Very Excellent. My problem solved.
How do we should recognize the name of parameter is “gam” ???

• Posted January 29, 2015 at 10:45 | Permalink

Thank you for your kind words :)
If in Simulink you right-click on the block of interest, you can proceed to view the block mask via “Mask→View Mask…” Then locate the “Parameters” tab and check out the Variable names there.

23. Reza
Posted January 29, 2015 at 13:06 | Permalink

i see!
Thank you for learning me a new Tip.
Best Regards,
Reza

24. Juliet Nirmala
Posted February 10, 2015 at 13:19 | Permalink

Sir, we are using your FOMCON toolbox to design fractional order controller for integer order system. We are using MATLAB 7.9.0(R2009b).the transfer function we used is G=tf([0.8 0.5],[2.2 0.9 0])
We copied all m-files and tried optimation using fpid optimisation tool we are getting these errors

??? Reference to non-existent field ‘G’.

Error in ==> fpid_optim>fpid_optim_OpeningFcn at 40
set(handles.txtPlant, ‘String’, toOpt.G);

Error in ==> gui_mainfcn at 221
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});

Error in ==> fpid_optim at 24
gui_mainfcn(gui_State, varargin{:});

Sir, please tell us how to overcome these errors
Thanks & Regards

• Posted February 10, 2015 at 14:32 | Permalink

I have also received your e-mail, but I did not yet have a chance to reply. So I will provide a possible solution here.
Are you certain that you have added all FOMCON folders and files onto MATLAB path? This basic functionality towards which the error is pointing should definitely be supported in MATLAB R2009b. Otherwise, my suggestion is to update your MATLAB version to at least R2012a.

25. Juliet Nirmala
Posted February 11, 2015 at 08:00 | Permalink

though i gave the iteration limit as 20 in FOPID optimization toolbox i am getting the following errors sir.

??? Maximum recursion limit of 100 reached. Use set(0,’RecursionLimit’,N)
to change the limit. Be aware that exceeding your available stack space can

Error in ==> margin

??? Error while evaluating uicontrol Callback

and also with the errors i mentioned in last post

??? Reference to non-existent field ‘G’.

Error in ==> fpid_optim>fpid_optim_OpeningFcn at 40
set(handles.txtPlant, ‘String’, toOpt.G);

Error in ==> gui_mainfcn at 141
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});

Error in ==> fpid_optim at 24
gui_mainfcn(gui_State, varargin{:});

Sir, pls help me to overcome these errors and suggest ur advice for the same.

• Posted February 11, 2015 at 09:07 | Permalink

The first problem is related to a particular controller design case. I cannot comment further until I see the parameters of the model/controller.
As for the second one, I have already pointed out, that it is not related to any bug in the FOMCON software, rather, there is some problem in the installation thereof.

26. Reza
Posted February 22, 2015 at 18:07 | Permalink

Dear professor,
I apologize that I disturb you again.
I want value of 0.5 in mu block is replaced with the command “set_param” in Fractional Order in FD block . Which block should I use insted of Embedded Matlab Function?
i tried to use different bloks, but i couldn’t successful!
my simulation :

Best Regards,
Reza

27. Reza
Posted February 26, 2015 at 19:25 | Permalink

Dear Dr. Aleksei
Can you answer my above question?
thanks a lot.

• Posted February 26, 2015 at 21:03 | Permalink

I am sorry, I do not quite understand the problem. Also unfortunately I cannot download the above archive as it is not hosted on a resource I am familiar with.

• Reza
Posted February 26, 2015 at 21:27 | Permalink

Can i email it for you?
the solve of this problem is very important for me.

Best Regards,
Reza

• Posted February 27, 2015 at 07:49 | Permalink

As long as it is not an archive, yes.

• Reza
Posted March 1, 2015 at 10:41 | Permalink

Dear professor,

I sent my file to your email (aleksei.tepljakov@dcc.ttu.ee).
Did you recieve it?

• Posted March 1, 2015 at 12:38 | Permalink

As I said, no archives please. If you must, send me the model and script files.

• Reza
Posted March 3, 2015 at 07:46 | Permalink

I’m sorry!
Where must i attach my file for you?

• Posted March 3, 2015 at 08:35 | Permalink

How many files are there?

28. Reza
Posted March 1, 2015 at 14:54 | Permalink

Excuse me, I do not understand what you mean.
Now What am i doing?
My problem is about the change of order of fractional in my simulink.

29. Reza
Posted March 3, 2015 at 15:25 | Permalink

There is one file namely “Test3.mdl” in ziped file :

30. Reza
Posted March 3, 2015 at 18:30 | Permalink

Dear professor,
Can you get my file?

• Posted March 3, 2015 at 21:17 | Permalink

Here is the problem.
I do not open zip/rar/etc. archives sent to me via e-mail.
I do not download zip/rar/etc. archives from sources, that are unknown to me.
If you send me the mdl/slx/m files, it is perfectly fine, as long as their number is limited.

31. Reza
Posted March 3, 2015 at 21:46 | Permalink

Can i send mdl file for you via e-mail?

• Posted March 3, 2015 at 22:51 | Permalink

Yes, I have received the e-mail. The way you call the “set_param” function is correct, but this function is not supported in code generation. So you may want to use S-functions instead.

32. senthil
Posted March 23, 2015 at 19:38 | Permalink

hai sir my fractional order transfer function is 3.09/11s^0.923+1 with time delay…my question is how to draw bode plot and also to find gain and phase margin….

33. Reza
Posted March 30, 2015 at 21:25 | Permalink

Dear Professor,
I complete my simulation and used FOPID in it. when I run the system the Matlab/Simulink will give this error :
Derivative input 1 of ‘FuzFOPID/Integrator8’ at time 5.75 is Inf or NaN. Stopping simulation. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances).

I tried to reduce the step size, changing the solver but only the time that error occurs will change.
How can I solve this problem?

Best Regards,
Reza

• Posted March 31, 2015 at 13:36 | Permalink

Please provide more details. Include as much information as possible, since I do not even know whether this is a FOMCON support question or not.

• Reza
Posted March 31, 2015 at 21:49 | Permalink

My problem solved. I think another part of my simulation was wrong and at present i could overcome it.
Thanks a lot.

34. Reza
Posted April 10, 2015 at 19:36 | Permalink

Hi Dear Professor,

I’m sorry to disturb you again.
In your Library:fod, there are not Fractional Derivative and Fractional Integrator for Discerete Time. only there is Transfer Function for Discerete Time. Is it right?
which block i should use?

• Posted April 12, 2015 at 10:49 | Permalink

Yes, it is somewhat of an oversight. If you wish, you can add a feature request at http://bugs.fomcon.net/
You can still use the Discrete FOTF block, just specify the b=1, a=s^n for an integrator or b=s^m, a=1 for a differentiator.

35. nathan
Posted October 16, 2015 at 11:29 | Permalink

sir,
I am using fractional order PI controller for controlling simulated pH process. Through some optimization technique, i am trying to tune the parameters of fractional order PI controller. I need a small suggestion that, what may be the maximum value of “integrator of order λ”?
I am using limit for λ is 0 to 2. pls give me as suggestion on this.
Regards
nathan

36. mak
Posted May 20, 2016 at 07:45 | Permalink

Do you have a simple method to calculate the fractional PID controller settings?
I would like to improve the quality of regulation of normal PID.

37. mak
Posted October 13, 2016 at 21:10 | Permalink

I have a question for the first time course for the ALPHA range . Do you know the best solution like – how in Simulink toolbox fomcon introduce fractional derivative of a specific range and not for one value?
Thanks a lot.

38. Malikwisha
Posted January 16, 2017 at 19:21 | Permalink

Sir, I am getting problem while I am trying to use glfdiff(y,t,gam) MATLAB function to detect edges in an image. Can, please Sir help me out with an example of how I can proceed.

39. Reza
Posted January 24, 2017 at 21:58 | Permalink

Dear Professor,

How can use charachter in fractional block?
for example i try to put “a” in Derivate order for Fractional Derivative and this way i update the parameter wiyh m-file. but it doesn’t accept!

can you help me?

• Posted January 25, 2017 at 10:17 | Permalink

There are several ways to achieve this. But the problem here most likely is that “a” is not defined when you plug it into the block settings. Create a workspace variable and see whether that works for you.