Sie sind auf Seite 1von 2

speed, rad/s

Embedded application of fractional order control

R. Duma, P. Dobra and M. Trusca

A practical closed loop fractional order control application is presented.

A fractional order PID (FOPID) controller has been designed for a DC

motor and the determined controller implemented in real-time on an embedded system. The implementation aspects on the embedded control system are described. In addition, a simple implementation approach for a FOPID controller is presented.

Introduction: An extension of the classical PID controller is the frac- tional order PID (FOPID) controller. The PID controller has three par- ameters which can be changed in order to tune the controller, while the FOPID controller has five. Thus, higher flexibility and better closed loop performance can be achieved using a FOPID controller. Fractional order calculus is used in a wide range of science and engin- eering fields and also in the field of control systems [1, 2] . In the litera- ture there are few papers which present practical implementations of FOPID controllers. A case study for FOPID control of a DC motor with an elastic shaft is presented in [3] . The paper [4] investigates several types of FOPID controllers for a laboratory servo system. The above-mentioned papers, which describe fractional order control systems for DC motors, present only theoretical results. Practical aspects on the implementation of a fractional controller on a microcon- troller are presented in [5]. In this Letter a FOPID controller is designed for a DC motor and a closed-loop control algorithm with a FOPID con- troller is implemented on a Stellaris LM3S8962 microcontroller. As far as we know, this is the first report which presents the implementation of a FOPID controller on a microcontroller and the control of a real process using the implemented code.

Controller design and discretisation: The transfer function of a FOPID controller is:

K FOPID ( s ) = K p + K i

s l + K d s m

where K p is the proportional gain, K i is the integration gain, K d is the derivative gain, l and m are the integral and the derivative orders, respectively.

Im(.) Re(.) N 1 (A) LC(A osc ,ω osc ) G(jω)
Im(.)
Re(.)
N 1 (A)
LC(A osc ,ω osc )
G(jω)

Fig. 1 Nyquist diagram of relay feedback system

The method used for controller tuning is based on limit cycle oscillation of the DC motor. A relay type nonlinearity is introduced in the control loop. The negative inverse describing function of the bi-positional relay with a hysteresis is:

N i ( A )=− p1

b

4

A

1

2

1 + j ;

A . 1

where b is the amplitude of the output signal of the relay, 1 the hysteresis of the relay and A the input sinusoidal signal. In the case of a negative feedback system which consists of a non- linear component of type relay and a linear component limit cycles appear. The parameters of the limit cycle can be estimated using the Nyquist diagram, from the intersection point of the transfer locus of

the linear part (G ( jw )) and the negative inverse description locus

N i ( A). As can be observed from Fig. 1, this is a stable limit cycle having parameters of the amplitude, A osc , and the frequency, v osc . The equivalent gain of the relay is computed using:

1

1 )

K u =

= 4 b

pA osc

N i ( A osc )

(

In the case of the practical application presented in this Letter a bi-positional relay with b ¼ 50 and 1 ¼ 5 is implemented in software.

The obtained limit cycle is transferred from the microcontroller over

the controller area network (CAN) bus of the microcontroller and is

presented in Fig. 2 . The speed of the motor sent over the CAN bus is an eight bit data type. To obtain the speed of the motor in rotations per minute, the value has to be scaled. As a consequence, the value for the amplitude of the limit cycle oscillation used in (1) has to be divided by 15. From the obtained limit cycle the amplitude of oscillation and the fre- quency are determined (A osc ¼ 8.5, v osc ¼ 7.629 rad/s).

2550

15.811 16 16.5 17 17.5 18 18.5 19 19.5
15.811 16
16.5
17
17.5
18
18.5
19
19.5

2500

2450

2400

2350

2300

2250

2200

time, s

Fig. 2 Limit cycle oscillation of DC motor

The purpose of a controller in a closed loop control system is to com- pensate for dominant time constants. A FOPID controller of the follow-

ing form is used:

K FOID ( s ) = K 1

T 1 s + 1

s m

=

K d s 1 m + K i s m

The

DC

responses of the DC motor to be 0.07 s. The fractional order m is com-

puted by imposing a fixed phase margin g k = p/ 6, at the frequency esti-

mated from the limit cycle, for the open loop system (fractional order controller and DC motor):

time constant T 1 is chosen to be the mechanical time constant of the

motor. The mechanical time constant is estimated from several step

g k = arg [ K FOID ( j v osc )G ( j v osc )] + p =

( 2 )

2

From (2) m is computed to be 0.295. To simplify the discretisation of s m

the value of m is chosen to be 0.3.

To obtain the imposed phase margin at the oscillation frequency the module of the open loop system must fulfil the condition:

|K FOID ( j v osc )G (j v osc ) | = 1 ( 3 )

From (3) K 1 is determined:

atan( T 1 v osc ) + − p m

+

arg [N i ( A osc )]

K 1 = K u

m

v

osc

= 11 . 9305 1 + ( T 1 v osc ) 2

The proposed fractional order controller is a derivative-integral fractional

order controller with: K d = K 1 T 1 = 0 .8351, K i = K 1 = 11.9305,

l = −m = −0 . 3 and d = 1 m = 0 .6. For discretisation of the fractional order integrator, s 2 0.3 , and frac- tional order differentiator, s 0.6 , the Al-Alaoui [6] operator is used.

The determined controller is presented below:

116 . 8 365 . 6 z 1 + 432 . 6 z 2 237 . 9 z 3 + 59. 3 z 4

K FOID ( z 1 ) =

5 . 32z 5 + 0 . 312z 6

1 2 . 34 z 1 + 1 . 88 z 2 0 . 56 z 3 + 0 .023 z 4

+ 0 . 0094z 5 0 . 0003z 6

( 4 )

Practical implementation: The setup presented in Fig. 3 has been used to test the approach proposed in this Letter. The DC motor used for the practical application has a nominal speed of 4500 RPM at 30 V. On the shaft of the motor an Agilent HEDS-5500 encoder is mounted. The

ELECTRONICS LETTERS 22nd November 2012 Vol. 48 No. 24

encoder gives 1000 counts per revolution. The quadrature signals are applied at the encoder input type pins of a Stellaris LM3S8962 micro- controller, on which the control algorithm is implemented. For real- time bidirectional data exchange between the PC and the microcontroller a USB to CAN converter is used.

driver Stellaris LM3S8962
driver
Stellaris LM3S8962

USB-CAN converter

DC motor

Fig. 3 Test setup for control of DC motor

The Stellaris LM3S8962 microcontroller is a fixed point controller. On fixed point controllers the execution time of algorithms which utilise double data type is significantly higher than in the case of algor- ithms which utilise integer data types. The integer data type can be used for the implementation of the controller algorithm but with loss of accu- racy. For the implementation of the FOPID controller presented in (4) the IQMath data type is used. The IQMath Library is a collection of highly optimised and high precision mathematical functions which allows the implementation of floating point algorithms on fixed point microcontrollers. An embedded control system is used for ensuring real-time constraints of the interrupts of the microcontroller. For controlling a DC motor a synchronous interrupt for control algorithm computation is required. In the case of the application presented in this Letter the synchronous interrupt is generated by the encoder velocity timer expiration. In this routine the speed of the motor is computed using the signals generated by the encoder; the FOPID control algorithm computes a new value for the duty cycle of the control PWM signal and relevant data is sent over the CAN bus. The closed-loop response of the DC motor using the FOPID control- ler defined in (4) is presented in Fig. 4 , while the response using a FOPID controller of fourth order is presented in Fig. 5 . The execution time on the microcontroller of the FOPID controller defined in (4) is 40 m s, while of the fourth order is 30 m s. For extensive computation applications a lower order FOPID controller can be used but with a degree of the closed-loop control performances.

3400 3200 3000 2800 2600 2400 2200 2000 1800 31.5 32 32.5 33 33.5 34
3400
3200
3000
2800
2600
2400
2200
2000
1800
31.5
32
32.5
33
33.5
34
34.5
35
35.5
36
36.5
37
37.5
38
38.5
39
39.5
40
40.5
41
41.5
42
speed, rad/s

time, s

Fig. 4 Closed-loop response of DC motor using FOPID controller of sixth order

3400 3200 3000 2800 2600 2400 2200 2000 1800 speed, rad/s
3400
3200
3000
2800
2600
2400
2200
2000
1800
speed, rad/s

8

8.5

9

9.5

10

10.5

11

11.5

12

12.5

13

13.5

14

14.5

15

15.5

16

16.5

17

17.5

18

18.5

19

 

time, s

Fig. 5 Closed-loop response of DC motor using FOPID controller of fourth order

Conclusion: We have presented the design and implementation of a FOPID controller for a DC motor. The control algorithm is implemented on a Stellaris LM3S8962 microcontroller. The main contribution of this Letter is the real-time implementation of the FOPID controller on a microcontroller and the control of the DC motor. A simple tuning method for FOPID controllers is proposed. The practical approach pre- sented in this Letter could be easily integrated by industry, because it proves that a FOPID controller can be easily implemented on an embedded system.

Acknowledgments: This paper was supported by project ‘Progress and development through post-doctoral research and innovation in engineer- ing and applied sciences – PRiDE’ – Contract no. POSDRU / 89 / 1.5/ S/ 57083. Project co-funded from European Social Fund through Sectorial Operational Program Human Resources 2007 – 2013.

# The Institution of Engineering and Technology 2012 24 May 2012 doi: 10.1049/el.2012.1829 One or more of the Figures in this Letter are available in colour online.

R. Duma, P. Dobra and M. Trusca ( Automatic Control Department, Technical University of Cluj –Napoca, Romania )

E-mail: dobra@aut.utcluj.ro

References

1 Valerio, D., and Costa, J.S.: ‘Introduction to single-input, single-output fractional control’, IET Control Theory Appl., 2011, 5 , (8), pp. 1033–1057, DOI:10.1049/ iet-cta.2010.0332

2 Jin, Y., Chen, Y.-Q., and Xue, D.: ‘Time-constant robust analysis of a fractional order [proportional derivative] controller’, IET Control Theory Appl., 2011, 5, (1), pp. 164–172, DOI:10.1049/iet-cta.2009.0543

3 Xue, D., Zhao, C., and Chen, Y.Q.: ‘Fractional order PID control of a DC motor with phase elastic shaft: a case study’. Proc. of 2006 American Control Conf., Minneapolis, MN, USA, 2006, pp. 3182–3187

4 Barbosa, R.S., Machado, J.A.T., and Jesus, I.S.: ‘On the fractional PID control of a laboratory servo system’. Proc. of 17th IFAC World Congress, Seoul, Republic of Korea, 2008, pp. 15273–15278

5 Petras, I.: ‘Fractional –order feedback control of a DC motor’, J. Electr. Eng., 2009, 60, (3), pp. 117–128

6 Al-Alaoui, M.A.: ‘Novel digital integrator and differentiator’, Electron. Lett., 1993, 29, (4), pp. 376–378

ELECTRONICS LETTERS 22nd November 2012 Vol. 48 No. 24