You are on page 1of 5

Available online at www.sciencedirect.

com

ScienceDirect
IFAC PapersOnLine 52-27 (2019) 288–292
PID
PID Control
Control of of Towercopter
Towercopter SystemSystem
PID Control
PID Jakub
Control of
of Towercopter
Towercopter System
System
Matišák, Danica Rosinová,
Jakub Matišák, Danica Rosinová,
Peter
JakubŤapák
Peter Matišák, and Katarína
andDanica Žáková
Rosinová,
JakubŤapák Matišák, Katarína
Danica Žáková
Rosinová,
Peter Ťapák and Katarína Žáková
Peter Ťapák and Katarína Žáková
Faculty
Faculty of of Electrical
Electrical Engineering
Engineering and and Information
Information Technology,
Technology,
Faculty of Electrical Slovak University
Engineering
SlovakEngineering of Technology,
and
University ofand Information Technology,
Technology,
Faculty of Ilkovičova
Electrical Information Technology,
Slovak3,
Ilkovičova 812
812 19,19, Bratislava,
University
3, of Technology,
Bratislava, Slovakia
Slovakia
(e-mail: Slovak University of Technology,
(e-mail: jakub.matisak@stuba.sk,
jakub.matisak@stuba.sk, danica.rosinova@stuba.sk,
Ilkovičova 3, 812 19, Bratislava,
danica.rosinova@stuba.sk,
Ilkovičova 3, 812 19, Bratislava,
peter.tapak@stuba.sk,
Slovakia
peter.tapak@stuba.sk,
Slovakia
katarina.zakova@stuba.sk)
katarina.zakova@stuba.sk)
(e-mail: jakub.matisak@stuba.sk, danica.rosinova@stuba.sk, peter.tapak@stuba.sk, katarina.zakova@stuba.sk)
(e-mail: jakub.matisak@stuba.sk, danica.rosinova@stuba.sk, peter.tapak@stuba.sk, katarina.zakova@stuba.sk)
Abstract:
Abstract: The The paper
paper deals deals with
with aa PID
PID controller
controller design
design for
for aa towercopter
towercopter plant. plant. Towercopter
Towercopter represents represents aa
laboratory
Abstract:
laboratory model
The
model paper of an
of an aerial
deals with
aerial vehicle
a PID
vehicle with one
controller degree
designof freedom.
for a PID
towercopter controller
plant. controls
Towercopter a height
representsof
of the
theaa
Abstract:above
propeller The paper
the deals
floor. with
The a PIDwith
required height
one degree
controller is designoffor
inserted
freedom.
by a user.
a
PID controller
towercopter
The main plant.
goal
controls a height
Towercopter
was to create represents
simulation
laboratory
propeller model
above of an aerial vehicle with one degree of freedom. PID controller controls a height of the
laboratory
model modeltheoffloor.
corresponding
The vehicle
antoaerial
the
requiredwith
towercopter
heightoneisdegree
and
inserted
design ofby
an
a user. The
freedom.
appropriate
main
PIDcontroller, goal was
controller controls
to
to create
verify a the simulation
height of the
designed
propeller above
model corresponding the floor. The
to the required height is inserted by a user. The main goal was to create simulation
propeller
controller above
on the floor. The towercopter
required heightandisdesign
insertedanbyappropriate The controller,
a user. with main goal was to verify
to create thesimulation
designed
model
controller
model on real
real towercopter
corresponding
corresponding to the
plant
plant and
to the towercopter
towercopter towercopter and to andcompare
to
and
design simulation
compare
design
an appropriate
simulation
an appropriate
real
real results.
with controller,results.
controller,
to The
to
verify
The
verify
paper
the describes
paper
the
designed
describes
designed
towercopter
controller
towercopter on plant
real
plant design,
design, its
towercopter hardware
plant
its hardware components,
and to compare
components, necessary
simulation
necessary hardware
with
hardware modifications,
real results.
modifications, The used
usedpapersoftware
describes
software and
and
controller
the controller on real
design towercopter
procedure. plant and to compare simulation with real results. The paper describes
towercopter
the plant
controllerplantdesign design, its
procedure. hardware components, necessary hardware modifications, used software and
towercopter design, its hardware components, necessary hardware modifications, used software and
the controller design procedure.
© 2019,
Keywords:
the IFAC
controller
Keywords: PID
PID (International
controller,
design procedure.
controller, Federation ofplant,
towercopter,
towercopter, Automatic
plant, Arduino,
Arduino,Control)
Matlab
Matlab Hosting by Elsevier Ltd. All rights reserved.
Keywords: PID controller, towercopter, plant, Arduino, Matlab
Keywords: PID controller, towercopter, plant, Arduino, Matlab
1.
1. INTRODUCTION measurement
INTRODUCTION measurement inaccuracyinaccuracy when when the the propeller
propeller is is spinning.
spinning. It It
Experimental work 1. should
INTRODUCTION be an integral part of the causes interference
measurement
causes interference and
inaccuracy therefore
when
and therefore is
the practically
propeller
is practically useless.
is spinning. It
Experimental work1. should INTRODUCTION be an integral part of the measurement inaccuracy when the propeller useless.
is spinning. It
educational
Experimental process
work at technical
atshould beuniversities.
an integralIt It allows
part ofbetter the causes
The
interference and therefore is practically useless.
educational
Experimental
understanding
educational
process
work
of
process the at
technical
should
theoretical
technical
beuniversities.
an integral
topics in
universities. mostIt
allows
part ofbetter
subjects.
allows
the
To
better The infrared
causes infrared sensor
interference
sensorand Sharp
therefore
Sharp is practically gives
GP2Y0A21YK0F
GP2Y0A21YK0F useless.
gives analogue
analogue
understanding
educational of
process the attheoretical
technical topics in
universities. mostIt subjects.
allows To
better output,
The
output, which
infrared
which can
sensor
can be
be affected
Sharp
affected by
GP2Y0A21YK0F
by noise.
noise. Datasheet
gives
Datasheet (Sharp,
analogue
(Sharp,
achieve
understanding
achieve this
this aim,
of theeducational
aim, theoretical institutions
educational topics in most
institutions try
try to
to provide
subjects.
provide To The 2015)
output,
infrared
declares
which
sensor
can that
be
Sharp
there
affected
GP2Y0A21YK0F
is bypractically
noise.
giveschange
no
Datasheet
analogue
(Sharp, in
understanding
students of the theoretical topics in most subjects. To 2015) declares
output, whichdistance that there
can be characteristics is
affected by noise.practically no
Datasheet change
(Sharp, in
achieve the
students thiswidest
the aim, possible
widest educational
possible range of
of experimental
rangeinstitutions
experimental try devices
to provide
devices and
and measurement
2015) declares that there is from
practically height
no of 50cm
change to
in
achieve
various this aim, educational institutions try to provide measurement
2015) declares distance
that characteristics
there is from
practically height
no of 50cm
change to
in
various ways
students
students ways
the
of
of teaching
the widest
widest
possibleincluding
teaching
possible
range of face-to-face
including
range of
experimentaleducation
face-to-face
experimental
devices and
education
devices
in
and 80cm,
in measurement
80cm, so
so it
it is
is very
distance
very hard
hard to
to recognize
characteristics
recognize distance
from
distance from
height
from the
of
the floor
50cm
floor to
laboratories,
various waysvirtual virtual experimentation
of teaching (e.g.
including face-to-face Stark et al., 2017) or measurement distance characteristics from height of 50cm to
laboratories,
various experimentation
ways of teaching experimentation
including (e.g. Stark et education
face-to-face al., 2017) or
education
in the
the platform
in 80cm, so it is(see
platform veryFig.hard 1.).
to So, we
we changed
recognize distance both sensors
from for
for the
the floor to
online
laboratories, virtual via
experimentation Internet (Restivo
(e.g. Stark and
et al., Cardoso,
2017) or 80cm,
new so it
one. Ouris(see
very
choice
Fig.
hard 1.).
was
So,
tothe
recognize changed
digital distance
sensor
both sensors
from
VL53L1X. the Itfloor
is
the
to
the
online experimentation
laboratories, virtual via Internet(e.g.
experimentation (Restivo
Stark and
et al., Cardoso,
2017) or the
new platform
one. Our(see(see
choiceFig. 1.).
was So,
the we changed
digital sensorboth both sensors
VL53L1X. for
Itfor
is the
2013).
online experimentation via Internet (Restivo and Cardoso, the platform
fastest miniature Fig. 1.). So,
Time-of-Flight we changed
sensor sensors the
2013).
online new one. Our choice was the digital sensoron the
the market
VL53L1X. It iswith
the
2013). experimentation via Internet (Restivo and Cardoso, accurate fastest
new
fastestone.miniature
Our choice
ranging
miniature up
Time-of-Flight
towas
4m the
and
Time-of-Flight digital
fast
sensor
sensoron
ranging
sensor on VL53L1X.
frequency
the
market
market It is
up
with
to the
with50
The
The disadvantage
2013).disadvantage is is that
that the
the cost cost ofof such
such devices
devices is is usually
usually accurate
fastest ranging up
miniature to 4m and fastsensor
Time-of-Flight rangingonfrequency
the market up to with50
quite
The high.
disadvantageOne solution
is that is
the to develop
cost of your
such own
devices device
is with
usually Hz
Hz (STMicroelectronics,
accurate ranging
(STMicroelectronics, up to 4m 2019).
and
2019). The
fast
The sensor
ranging
sensor has
has three
frequency
three modes
up
modes to of
50
of
quitedisadvantage
The high. One solution is that isthe to cost
develop yourdevices
of such own device accurate ranging
with distance
is usually measurement up to 4m – and fast
short, ranging
medium, frequency
long. Laser up to 50
sensor is
the required
quite high. functionality.
One solution isAn to example
develop of such
your owna device
device canwithbe Hz (STMicroelectronics,
distance measurement – 2019).
short, The
medium, sensor has
long. three
Laser modes
sensor of
is
the required
quite high. functionality.
One solution isAn toexample
develop of such
your owna device
device canwith Hz (STMicroelectronics,
be connected to the floor 2019).
of the The sensor hasplant
towercopter three and modes it of
found
the
found in
required
in (Ťapák,
(Ťapák, 2016)
functionality.
2016) or
or An(Malatinec
example
(Malatinec et
of
et al.,
such
al., 2014).
a device
2014). It
It can
can
can be
be
distance
connected measurement
to the floor – short,
of the medium,
towercopter long. Laser
plant sensor
and it is
the required functionality. An example of such acontrol
device can be distance
pointing measurement
to platform. – short, medium, long. Laser sensor is
used
found in
in (Ťapák,
subjects 2016)
devoted or to automation
(Malatinec et and
al., 2014). It and
can it
be connected
pointing to to the
platform. floor of the towercopter plant and it is
used in subjects
found into(Ťapák, devoted
2016) to automation
orof(Malatinec and
et al., control and it connected
2014). It can be pointing to platform. to the floor of the towercopter plant and it is
enables
used
enables in to verify
subjects
verify all
all steps
devoted
steps of to the
the controller
automation
controller design.
and
design.control and it • Brushless Motor EMAX XA2212 and propeller,
used in subjects devoted to automation and control and it pointing to platform.
• Brushless Motor EMAX XA2212 and propeller,
enables to verify all steps of the controller design. • Brushless Motor EMAX XA2212 and propeller,
enables to verify 2. TOWERCOPTER
all steps of the HARDWARE
controller design.
2. TOWERCOPTER HARDWARE The
The •Emax
Emax XA2212
Brushless
XA2212Motor -- 1400kv
EMAXis
1400kv aa 51g,
51g, 245
is XA2212 and Watt
245 400
400 class
propeller,
Watt class
The 2. TOWERCOPTER HARDWARE
The used
used towercopter
towercopter
2. TOWERCOPTER
plant
plant was was built
built in
in our
HARDWARE our laboratory.
laboratory. The The motorThe
motor
The
that
Emax
that
Emax
is
is a
a good
XA2212
good
XA2212
choice
- 1400kv
choice
- 1400kv
for
for pusher-prop
is a 51g,
pusher-prop
is a 51g,
245
245
FPV
FPV planes,
Watt 400flying
planes,
Watt 400
class
flying
class
original
The usedmodel
original model described
towercopter
described plant in
in was (Sabol,
built2017)
(Sabol, in ourwas
2017) was adopted
laboratory.
adopted The and wings,
and motor and
that ismost
a goodplanes
choice weighing
for up
pusher-prop to 2 lbs
FPV (0.9kg)
planes, that can
flying
The
some used towercopter
significant changes plant
were wasmadebuilt
to in
its our laboratory.
structure, mainly Thein wings,
motor and
that ismost
a goodplanes
choice weighing
for up
pusher-prop to 2 lbs
FPV (0.9kg)
planes, that can
flying
original
some model
significant described
changes were in (Sabol,
made to 2017) was
its structure, adopted
mainlyandand
in useuse an
wings, 8 inch
and prop
most (30.32cm)
planes weighing (Life, 2019).
up to 2 In
lbs Fig. 1.
(0.9kg) it is shown
that can
original
the part modelsensors.
with described The intowercopter
(Sabol, 2017)
plant was adopted
consists of five an 8and
wings, inchmostpropplanes
(30.32cm) weighing (Life,up 2019).
to 2 In
lbs Fig. 1. it isthat
(0.9kg) showncan
some
the partsignificant
with sensors.changes were
Thewere made
towercopter to its structure,
plant consists mainly
of five in that
use the
an 8 motor
inch is
prop connected
(30.32cm) to the
(Life, platform
2019). In from
Fig. the
1. it top
is side.
shown
some
main significant
parts: changes made to its structure, mainly in usethatanthe8 motor
inch is connected
prop (30.32cm) to(Life,
the platform
2019). In from
Fig. theit is
1. topshown
side.
the part with sensors. The towercopter plant consists of five The propeller
motoris isscrewed at
main with sensors. The towercopter plant consists of five that
parts:
the part
main parts: The the
propeller
that the
connected
motorisisscrewed
connected at theto the
the
to the
top of
of the
the motor.
top platform
platform
from the top side.
motor.
from the top side.
main••parts: The propeller is screwed at the top of the motor.
Arduino
Arduino UNO UNO R3, R3, The ••propeller
Brushless
Brushless Electronic Speed Controller EMAX
is Electronic
screwed at the Speed
top of Controller
the motor. EMAX Simon Simon
• Arduino UNO R3, • Series
Brushless 25A,
• is
Arduino
Arduino aa microcontroller
Arduino
is UNO R3, board
microcontroller board based
based on on the
the ATmega328P
ATmega328P Series 25A,Electronic Speed Controller EMAX
• Brushless
Electronic Speed Controller
EMAX
Simon
Simon
microchip
Arduino is (Arduino, 2019).
a microcontroller It is
board used
basedto control
on towercopter
the ATmega328P Series 25A,
microchip (Arduino, 2019). It is used to control towercopter This
This controller is based on SimonK firmware, optimized to
controller
Series is
25A, based on SimonK firmware, optimized to
Arduino
and to
microchip is (Arduino,
a microcontroller
communicate with
2019). MATLABboard based
It is used to on
Simulink thevia
control ATmega328P
USB Serial
towercopter
and to
microchipcommunicate
(Arduino, with
2019). MATLAB It is usedSimulink
to controlvia USB Serial
towercopter perfect
This
perfect drive
controller
drive performance.
is based onIt
performance. It has
SimonK
has low-voltage
firmware,protection
low-voltage optimizedand
protection to
and
link.
and to communicate with MATLAB Simulink via USB Serial over-heat This controller is
protection. based Moreon SimonK
information firmware,
can be optimized
found in to
the
link.
and to communicate with MATLAB Simulink via USB Serial over-heat perfect drive performance.
protection. More It has low-voltage
information can beprotection
found in and
the
link. perfect
datasheet drive performance. It has low-voltage protection and
link.•• Laser
Laser Sensor
Sensor VL53L1X,
VL53L1X, datasheet (EMAX,
over-heat
over-heat
protection.2012).
(EMAX,
protection.
MoreIn
2012).
More
Fig.
Fig. 1.
Ininformation
information1. itit cancan be
can
can be
be seen,
foundthat
be seen,
found thatin the
inside.
the
• Laser Sensor VL53L1X, controller
datasheet
controller is
is connected
(EMAX,
connected 2012). to
to the
In
the platform
Fig.
platform1. it from
can
from the
be
the bottom
seen,
bottom that the
side.

Originally, Laser the towercopter
Sensor VL53L1X, plant was equipped with infrared datasheet
The ESC (EMAX,
(electronic 2012).
speed In Fig.
controller) 1. it can
input be
is seen,
a pulse thatwidththe
Originally, the towercopter plant was equipped with infrared The controller
ESC is connected
(electronic to
speed the platform
controller) from
input the
is a bottom
pulse side.
width
sensor controller is connected to the platform from the bottom side.
sensor Sharp
Originally,
Sharp
Originally,
theGP2Y0A21YK0F
towercopter plantAnalog
theGP2Y0A21YK0F
towercopter plant Analog Distance
was equipped
Distancewith
was equipped
Sensor,
Sensor,
with
and
infrared
and The
infrared
modulated
modulated
The ESC1000µs
signal
signal with
ESC (electronic
(electronic
the
the frequency
withspeed
speed
controller)
frequency
controller)
of
of 50Hz.
input is
50Hz.
input
The
The
is
pulse
a pulse
pulse width
a pulse width
width
Ultrasonic
sensor
UltrasonicSharp Sensor
Sensor HC-SR04
GP2Y0A21YK0F (Tutorials,
HC-SR04 (Tutorials, Analog 2014).
Distance
2014). They
They served
Sensor,
servedand for
and between
modulated
for between signal and
with 2000µs
the corresponds
frequency of 50Hz. to -100%,
The pulse100% width of
sensor
distance Sharp
(height) GP2Y0A21YK0F
measurement. Analog
The Distance
ultrasonic sensorSensor,
has high modulated 1000µs
signal and 2000µs
with thethe corresponds
frequency ofidling. to
50Hz. The -100%, pulse100% width of
Ultrasonic
distance Sensor
(height) HC-SR04 (Tutorials, 2014). They served for motor
between speed.
1000µs At 1500µs
and 2000µs motor
correspondsis to We
-100%, used100% signalof
Ultrasonic Sensormeasurement.
HC-SR04 (Tutorials, The ultrasonic sensorserved
2014). They has high for motor
between speed.
1000µs At and1500µs2000µsthe motorcorrespondsis idling. to We used
-100%, 100% signalof
distance (height) measurement. The ultrasonic sensor has high motor speed. At 1500µs the motor is idling. We used signal
distance (height) measurement. The ultrasonic sensor has high motor speed. At 1500µs the motor is idling. We used signal
2405-8963 © 2019, IFAC (International Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved.
Peer review under responsibility of International Federation of Automatic Control.
10.1016/j.ifacol.2019.12.675
Jakub Matišák et al. / IFAC PapersOnLine 52-27 (2019) 288–292 289

width in microseconds as input parameter for take-off speed toolbox. MATLAB was used to analyse data both for a system
for propeller. identification and for a PID controller design. More details are
presented in Section 4. MATLAB Simulink was used to create
• Guiding rods. a control loop model, both for simulation and for real
Guiding rods are connected to the platform and serve as experiments.
platform guides. Towercopter guiding rods are limited to the 4. SYSTEM IDENTIFICATION AND PID CONTROLLER
length of 0.8m. DESIGN
The plant is determined for teaching controller design that
usually starts with the identification of the system.

4.1 Identification

In identification part, several skills can be trained as:


a) Basic steps of identification procedure for a real
system
- working points (WP) have to be determined based on
a measured steady-state input–output response, WP
should be chosen in the linear part of the steady-state
response
- step response has to be measured around the working
point
- dynamic model has to be identified: firstly, its
structure is assessed corresponding to the step
response, secondly the parameters are determined
- the obtained model has to be verified – compared
with measured data.
b) Matlab tools for modelling and model optimization
that can be efficiently used in all steps of
identification
- transfer functions as well as time functions are used
to model the system dynamics
- step response to be received as a time function,
Matlab function ilaplace can be applied on transfer
function
Fig. 1. Towercopter construction
- nonlinear optimization is used to fit dynamic model
3. TOWERCOPTER SOFTWARE FOR MEASUREMENT parameters to the measured data.To start the
AND CONTROL identification, the steady-state response was obtained
The communication with towercopter was realised using by measuring the distance between floor and the
Arduino IDE software. The input to Arduino console is ESC propeller at the specific speed. It was realized by
that controls the pulse, which corresponds with speed of the increasing ESC signal by 5µs every 20s. Fig. 2.
propeller. As it was detected, 1510µs input is needed to take shows the average measured height, for the signal
the propeller off, its maximal height is maintained at 1620µs. width from 1510µs (take off point) to 1620µs
The output from Arduino console is a number which represents (guiding rods distance limit).
distance (in mm) between sensor on the floor and the platform.
The measurement sampling period is 20ms. It was necessary
to check the measurement frequency before the sensor
replacement, because we wanted to measure distance within
one sampling period required for the height control. The value
was checked in datasheet and verified by real-time
measurement test on Arduino. The sampling period 20ms can
be reached by setting the laser sensor to short distance mode.
It is to note that the measurement with this sampling is possible
only up to 0.8m.
As a simulation tool we used MATLAB, because it is the most Fig. 2. Measured data - the height dependence on ESC input
common used computing environment with simulation signal pulse width (µs)
290 Jakub Matišák et al. / IFAC PapersOnLine 52-27 (2019) 288–292

As we can see, data from ESC input at 1600µs are less precise, 𝑡𝑡𝑡𝑡
1
𝑦𝑦𝑦𝑦(𝑡𝑡𝑡𝑡) = 𝐾𝐾𝐾𝐾 ∆𝜔𝜔𝜔𝜔 �1 − �1 + 𝑡𝑡𝑡𝑡� 𝑒𝑒𝑒𝑒 −𝑇𝑇𝑇𝑇 �. (4)
because of longer distance between the sensor and the 𝑇𝑇𝑇𝑇
platform.
The step response (4) was fitted to measured data by a
We considered working points for the distances between nonlinear least square solver. Least squares fitting was
450mm and 600mm, which corresponds to ESC from 1540µs performed numerically by Matlab function lsqnonlin, where
to 1600µs, represented in Fig. 2. by green line. For these the function parameters are optimized by one of iterative trust
working points, the system can be represented by a linearized region methods – trust region reflective or Levenberg
model and corresponding transfer function. The input variable Marquardt. More can be found in (The MathWorks, 2019).
– the ESC is below denoted by ω, the output variable - the
height of the propeller is denoted by h. The optimized parameters are K1 = 2.6008 and T1 = 0.6960.
The corresponding step response is shown in Fig. 3. – green
To identify the system transfer function, we set control signal line, which fits the average of measured data. The resulting
pulse width to 1540µs. In this steady state we applied the step transfer function is
change to 1600µs. We measured the corresponding step
response (blue signal in Fig. 3.) to be modelled by a linear 2.6008
𝐺𝐺𝐺𝐺(𝑠𝑠𝑠𝑠) = (5)
system. Identification was performed in MATLAB 0.4844 𝑠𝑠𝑠𝑠2 + 1.392 𝑠𝑠𝑠𝑠 + 1
environment and model parameters were optimized. The
details are described below. 4.2 MATLAB PidTuner and Simulation

After having identified the transfer function, we proceeded to


PID controller design. We consider PID controller with
transfer function
𝐼𝐼𝐼𝐼
𝐺𝐺𝐺𝐺𝑅𝑅𝑅𝑅 (𝑠𝑠𝑠𝑠) = 𝑃𝑃𝑃𝑃 + + 𝐷𝐷𝐷𝐷𝑠𝑠𝑠𝑠 (6)
𝑠𝑠𝑠𝑠
To simplify the design, we used MATLAB PidTuner, which is
a tool developed for PID controllers design based e.g. on
transfer function input (MathWorks, 2019). In PidTuner,
standard PID tuning objectives can be considered: closed-loop
stability, adequate performance (the response time determined
by the loop bandwidth) and adequate robustness (gain and
phase margins). By default, the tuning algorithm chooses a
crossover frequency (loop bandwidth) based on the plant
Fig. 3. Measured time and altitude when operating ESC is dynamics, and designs for a target phase margin of 60°. We
changed from 1540µs to 1600µs. tested several configurations of tuning requirements and
validated the results by simulation and on the real plant.
Considering the measured step response and assumed
dynamics of the towercopter (Sánchez-Benítez, et al., 2012), 5. SIMULATIONS AND REAL PLANT EXPERIMENTS
we used the second order linearized model with transfer At first, several problems arose. First real tests after simulation
function: ended with crash, because configuration of PID controller was
𝐾𝐾𝐾𝐾 (1) too aggressive. We had to create slower and more robust
𝐺𝐺𝐺𝐺0 (𝑠𝑠𝑠𝑠) = 2 configuration, because of the limited guiding rods height. We
(𝑇𝑇𝑇𝑇𝑠𝑠𝑠𝑠 + 1)
used PidTuner again to tune the parameters and to make a
Unknown parameters - gain 𝐾𝐾𝐾𝐾 and time constant 𝑇𝑇𝑇𝑇, were controller response slower and less aggressive. We tested it
firstly estimated by initial guess: the initial gain was settled as again on simulation and then we used this better fitting
∆ℎ 600 − 450 (2) configuration.
𝐾𝐾𝐾𝐾0 = = = 2.5
∆𝜔𝜔𝜔𝜔 1600 − 1540 The best fitting option is described by P = 3.5830 * 10-5, I =
where ∆𝜔𝜔𝜔𝜔 denotes the input – ESC step change and ∆ℎ denotes 1.551 * 10-3 and D = 3.877 *10-4 as proportional, integrating
the corresponding change of the output – height. and derivation controller parameters.
The initial value of time constant was set to 𝑇𝑇𝑇𝑇0 = 1. The step
Simulation results can be seen in Fig. 4. The required altitude
response for initial values 𝐾𝐾𝐾𝐾0 , 𝑇𝑇𝑇𝑇0 and input step ∆𝜔𝜔𝜔𝜔 is depicted
is 50cm and starting point altitude 40cm and as we can see, the
by a red line in Fig. 3. Obviously, there is a significant
system is stable. Starting simulation time (x-axis) is set to 60
difference between measured data (blue) and model with
seconds, because we want to compare it with real experiment.
initial parameters, therefore, the values of 𝐾𝐾𝐾𝐾 and 𝑇𝑇𝑇𝑇 were further
We chose the real experiment time, because the propeller
optimized using the step response corresponding to (1):
𝑡𝑡𝑡𝑡
needs to get to the working point after taking off and it takes
1
𝑦𝑦𝑦𝑦(𝑡𝑡𝑡𝑡) = 𝐾𝐾𝐾𝐾 �1 − �1 + 𝑡𝑡𝑡𝑡� 𝑒𝑒𝑒𝑒 −𝑇𝑇𝑇𝑇 �. (3) some time, so Fig. 4 does not include the first phase: moving
𝑇𝑇𝑇𝑇
the real propeller to the working point.
As we consider the measured step response for input step ∆𝜔𝜔𝜔𝜔,
we use below the corresponding step response
Jakub Matišák et al. / IFAC PapersOnLine 52-27 (2019) 288–292 291

Fig. 6. Laser Transmitter pointing to actual altitude


Fig. 4. Simulation of the towercopter - required altitude 50cm
(blue line), simulated altitude (red line) As we can see, the response from the towercopter is little
bit slower than in the simulation. It can be caused by small
After the simulation, we tested our solution again on a real sensor interference and inaccuracies in the construction of the
device. Arduino, which controls the towercopter is connected towercopter, which can cause jamming of platform on guiding
via a USB serial link to a computer running the simulation rods.
environment Matlab Simulink. In Simulink we created a block
diagram with PID controller and with the block, which
represents communication with Arduino.
As an input to the diagram, an altitude is required. Then, in
each sampling period Simulink sends information about the
propeller to Arduino and controller is then changing ESC to
set the propeller to the required altitude. As a response from
Arduino, we get the actual altitude of the propeller.
The result can be seen on Simulink graph (Fig. 5.), but also,
we used Arduino laser transmitter KY-008, which is pointing
from the platform to the meter, set on the left hand side of the
towercopter (Fig. 6.). All results from real device can be seen
in Fig. 5.

Fig. 7. Running experiment

6. CONCLUSION
The paper deals with designing of PID controller for the
towercopter plant. The device can be used in education process
as a demonstration plant. Working with real device can help in
Fig. 5. Real experiment - required altitude - 50cm (blue line), teaching process, because students can see the whole process
measured altitude (red line) from the identification, through modelling to the controller
design and implementation. However, towercopter plant has
one disadvantage, which is relatively high noise level when the
propeller is spinning.
292 Jakub Matišák et al. / IFAC PapersOnLine 52-27 (2019) 288–292

ACKNOWLEDGMENT technologies and applications ICETA. Stary Smokovec,


The work has been supported by the grants VEGA 1/0745/19 Slovakia.
and APVV SK-IL-RD-18-0008. This support is gratefully The MathWorks, I., (2019). Solve nonlinear curve-fitting
acknowledged. (data-fitting) problems in least-squares sense - MATLAB
lsqcurvefit. [Online] Available at: https://www.m-
Authors would like to thank to their colleagues for help with
athworks.com/help/optim/ug/lsqcurvefit.html [Accessed
design, construction and implementation.
2019].
Tutorials, R. N., (2014). Complete Guide for Ultrasonic Sensor
REFERENCES HC-SR04 with Arduino. [Online] Available at:
https://randomnerdtutorials.com/complete-guide-for-ultra
Arduino (2019). Arduino Uno Rev3. [Online] Available at:
sonic-sensor-hc-sr04/ [Accessed 2019].
https://store.arduino.cc/arduino-uno-rev3 [Accessed
2019].
EMAX, n.d. Emax User Instruction for SimonK Series ESC.
[Online] Available at: http://yinyanmodel.com/EMAX%2
0User%20Instruction%20for%20Simonk%20Series%20E
SC.pdf [Accessed 2019].
Life, R., (2019). Emax XA2212 1400KV 20A Brushless
outrunner motor. [Online] Available at: https://www.rclife.
co.uk/Emax-XA2212-1400KV-20A-Brushless-outrunner-
motor [Accessed 2019].
Ligušová, J., Liguš, J. and Zolotová, I. (2013). Cybernetic
education centre. 24th EAEEIE Annual Conference,
Chania, pp. 133-138.
Malatinec, T., Popelka, V., Huba, M. and Hudačko, P. (2014).
Laboratory model helicopter control using a lowcost
Arduino hardware. Proceedings of the 15th International
Carpathian Control Conference (ICCC), Velke Karlovice,
Czech Republic, pp. 326-331.
MathWorks, (2019). Pid Tuning - Matlab & Simulink.
[Online] Available at: https://www.mathworks.com/disco
very/pid-tuning.html [Accessed 2019].
MathWorks, (2019). Transfer function model - MATLAB.
[Online] Available at: https://www.mathworks.com/help/c
ontrol/ref/tf.html [Accessed 2019].
Restivo, M. R. and Cardoso, A. (2013). Exploring Online
Experimentation, International Journal of Online
Engineering (iJOE), Vol. 9.
Sabol, P., (2017). Internet-based control of towercopter,
Diploma thesis [in Slovak]. Bratislava: FEI STU.
Sánchez-Benítez, D., Portas, E. B., Cruz, J. M. l. & Pajares, G.
(2012). Vertical rotor for the implementation of control
laws. IFAC Proceedings Volumes, Volume 45, Issue 11.
Sharp, (2015). GP2Y0A21YK0F Datasheet. [Online]
Available at: http://www.sharp-world.com/products/devi
ce/lineup/data/pdf/datasheet/gp2y0a21yk_e.pdf [Accessed
2019].
Stark, E., Bistak, P., Kozak, S. and Kucera, E. (2017). Virtual
laboratory based on Node.js technology. 21st International
Conference on Process Control (PC), Strbske Pleso, pp.
386-391.
STMicroelectronics, (2019). VL53L1X - Long distance
ranging Time-of-Flight sensor based on ST FlightSense
technology. [Online] Available at: https://www.st.com/en/-
imaging-and-photonics-solutions/vl53l1x.html [Accessed
2019].
Ťapák, P. (2016). One degree of freedom copter. 14th IEEE
International conference on emerging elearning

You might also like