You are on page 1of 2

International Journal of Control, Automation and Systems 17(X) (2019) 1-8 ISSN:1598-6446 eISSN:2005-4092

http://dx.doi.org/10.1007/s12555-018-0394-1 http://www.springer.com/12555

Fuzzy Controller for Laboratory Levitation System: Real-time Experi-


ments Using Programmable Logic Controller
Kamil Czerwiński, Andrzej Wojtulewicz, and Maciej Ławryńczuk*

Abstract: Development of a Fuzzy Proportional Integral Derivative (FPID) controller for a laboratory magnetic lev-
itation process is described. The process is unstable and nonlinear, it is impossible to use a classical PID controller
which works correctly. The process is very fast: the sampling period is 1 ms. The FPID controller is implemented
using the R04 (the iQ-R family) Programmable Logic Controller (PLC) produced by Mitsubishi Electric.

Keywords: Fuzzy control, magnetic levitation, nonlinear control, programmable logic controller.

1. INTRODUCTION linearization controller [14] have been developed.


In addition to nonlinear and open-loop unstable nature
The magnetic levitation phenomenon has many appli- of the considered process, an important practical difficulty
cations: suspension of high velocity trains [11], suspen- results from its nature of dynamics. The levitation system
sion of superconductor rotors in gyroscopes [5], levitation is very fast, it needs controllers which work on-line with
in wind tunnels [22] and attenuation of mechanical vibra- the sampling time of the order of single milliseconds. Al-
tions [3]. Recently, very precise nanopositioning systems though it is acceptable in a laboratory environment to use
based on magnetic levitation have been developed [18]. a fast PC computer as a controller, in practical applica-
They may be used during medical treatment, in particular tions Programmable Logic Controllers (PLCs) are typi-
in minimally invasive surgery. In such an approach a lev- cally used [20]. Hence, for the levitation process a non-
itation platform can be inserted into a patients abdominal linear control strategy is necessary, but at the same time it
cavity to perform diagnosis or/and a surgery procedure. It should be as simple as possible to complete on-line calcu-
significantly reduces the level of incision. Magnetic levi- lations fast.
tation may be also used to manage a robotic camera used This work reports development of a Fuzzy PID (FPID)
for minimally invasive surgery [7]. controller to a laboratory magnetic levitation process [9].
Effective control of magnetic levitation is difficult be- In contrast to neural network-based control strategies typ-
cause the process is unstable and nonlinear. When the set- ically used for the considered process [13, 16, 23], it is
point is not changed in a broad range, one may use a clas- significantly less complicated in two respects: the tuning
sical linear Proportional Integral Derivative (PID) con- procedure is straightforward and computational complex-
troller [12]. Unfortunately, it is practically impossible to ity of the control law is low. Thanks to computational effi-
find a correctly working linear controller in a broad range ciency of the controller, although the sampling period is as
[2]. Hence, a number of nonlinear control approaches short as 1 ms (fixed by the producer), the FPID controller
have been applied to levitation processes. For the labora- is implemented using the R04 (the iQ-R family) PLC pro-
tory magnetic levitation system discussed in this work [9], duced by Mitsubishi Electric. Different variants of fuzzy
it is possible to use an adaptive neural controller trained controllers are used in industrial process control, example
on-line in real-time [13] or a two-stage neural sliding- applications are: a pH neutralisation process [17], a boiler-
mode controller [23]. In these approaches the controllers turbine unit [21], a stirred tank chemical reactor [24]. The
cooperate with a neural network. A fully neural controller fuzzy controllers may be also used to effectively control
which calculates on-line the manipulated variable of the other processes, e.g. autonomous underwater vehicles [6],
process is also possible [16]. For other levitation systems container cranes [10], greenhouses [19]. The mentioned
a nonlinear model predictive controller [1, 15], a nonlin- processes are significantly slower than the levitation sys-
ear saturation controller [4] and an input-output feedback tem, which is a real challenge.

Manuscript received June 12, 2018; revised December 7, 2018; accepted January 30, 2019. Recommended by Associate Editor Jiuxiang
Dong under the direction of Editor Guang-Hong Yang.

Kamil Czerwiński, Andrzej Wojtulewicz, and Maciej Ławryńczuk are with the Institute of Control and Computation Engineering, Faculty
of Electronics and Information Technology, Warsaw University of Technology, ul. Nowowiejska 15/19, 00-665 Warsaw, Poland (e-mails:
kczerwi2@mion.elka.pw.edu.pl, A.Wojtulewicz@stud.elka.pw.edu.pl, M.Lawrynczuk@ia.pw.edu.pl).
* Corresponding author.

⃝ICROS,
c KIEE and Springer 2019
2 Kamil Czerwiński, Andrzej Wojtulewicz, and Maciej Ławryńczuk

2. LABORATORY MAGNETIC LEVITATION


PROCESS AND LABORATORY SET-UP

A laboratory magnetic levitation process produced by


INTECO (http://www.inteco.com.pl) is used [9]. Fig. 1
shows the process with a levitating ball. The process con-
sists of: a frame, two electromagnets, a ferromagnetic
sphere, a position sensor (light is emitted on the left side
of the frame and the sensor located on the right side mea-
sures ball position) and coil current sensors. Fig. 2 shows
the laboratory set-up which includes: the process, the PLC
with a Liquid Crystal Display (LCD) panel and a power Fig. 1. The laboratory magnetic levitation process.
supply. Fig. 3 schematically depicts configuration of the
laboratory set-up. The levitation process has one manipu-
lated variable (the process input) and one controlled vari-
able (the process output). The manipulated variable is the
Pulse Width Modulated (PWM) duty cycle (0–100%) re-
lated to the current which drives the upper electromagnet
(the lower one is inactive) and the controlled variable is
the the ball position (mm). The sampling time of the pro-
cess is 1 ms, i.e., the ball position is measured and the
controller changes the value of the manipulated variable
as frequently as 1000 times per second. Additionally, as
shown in Fig. 3, a PC computer running MATLAB and an
LCD panel are connected to the PLC.
The PC computer and the LCD panel are used only for
data acquisition and user control, the PC computer does Fig. 2. The laboratory set-up.
not calculate on-line the value of the manipulated variable.
In existing works concerned with the considered levitation Levitation
u (PWM)

system, e.g., [9, 12], the user designs a controller directly process
PLC
from MATLAB/Simulink and the PC computer is used for
on-line control in real time. In contrast to these works
Power
in this study the control algorithms are implemented us- interface
ing the PLC, the PC may be switched off. The modu-
lar Mitsubishi iQ-R PLC controller is used. The PLC set y (Analog)
(Fig. 3) includes: the power supply (0), the PLC R04CPU
controller (CPU), the analog input R60AD4 module (2)
and the PWM output RD62P2E module (3). The PLC
Ethernet
R04CPU offers as many as 40K steps of program memory HMI
Switch
and 2M data memory. The Structured Text (ST) language
is used. The CPU used in very fast, e.g. the instruction LCD panel
PC
processing time necessary to perform the LD and MOV
Data acquisition and user control
instructions is 0.98 ns and 1.96 ns, respectively. Process-
ing time for IF, CASE and FOR instructions is 1.96 ns. Fig. 3. Configuration of the laboratory set-up.

3. CONTROLLER STRUCTURES AND TUNING


( ∫ )
1 t de(t)
Let the manipulated variable (the PWM driving the u(t) = u0 + K e(t) + e(τ )dτ + Td , (1)
Ti 0 dt
electromagnet) be denoted by u and the controlled one (the
analog signal related to the ball position) by y. The desired
where e = ysp − y is the control error, K is the gain, Ti
set-point of the controlled variable is ysp .
and Td are integral and derivative time constants, respec-
tively. To obtain the discrete-time PID controller, integra-
3.1. PID controller
tion is performed by the trapezoid method and for differ-
In continuous-time domain the value of the manipulated entiation the Euler difference is used. In the discrete-time
variable calculated on-line by the PID controller is domain, the value of the manipulated variable calculated

You might also like