Uploaded by Abdallah LADAICYA

Arduino Support for Personalized Learning of Control Theory Basics

advertisement
Available online at www.sciencedirect.com
ScienceDirect
IFAC PapersOnLine 52-27 (2019) 217–221
Arduino
Arduino Support
Support for
for Personalized
Personalized Learning
Learning
Arduino of
Support
for
Personalized
Learning
Control
Theory
Basics
Arduino of
Support
for
Personalized
Learning
Control
Theory
Basics
of Control Theory Basics of Control
Theory Basics
Pavol Bisták ∗∗∗
Pavol Bisták ∗∗
Pavol Bisták
∗
∗
Pavol BistákUniversity
of
Automotive
Mechatronics,
of
∗
∗ Institute
Institute
of
Automotive
of Technology
Technology in
in
Mechatronics,
University
∗
∗ Institute
of Automotive
Mechatronics,
University of Technology in
Bratislava,
Slovakia
(e-mail:
pavol.bistak@stuba.sk).
Bratislava,
Slovakia
(e-mail:
pavol.bistak@stuba.sk).
∗
Institute
of Automotive
Mechatronics,
University of Technology in
Bratislava,
Slovakia
(e-mail: pavol.bistak@stuba.sk).
Bratislava, Slovakia (e-mail: pavol.bistak@stuba.sk).
Abstract:
Abstract: This
This paper
paper discusses
discusses a
a possibility
possibility how
how to
to make
make learning
learning of
of control
control theory
theory basics
basics more
more
interesting for
anpaper
individual
learner.
Specifically,
anmake
approach
of of
learning
by
doingbasics
is applied
Abstract:
This
discusses
a
possibility
how
to
learning
control
theory
more
interesting
for
an
individual
learner.
Specifically,
an
approach
of
learning
by
doing
is
applied
Abstract:
This
discusses
a architecture
possibility
how
learning
of
control
theory
more
when usingfor
a low-cost
Arduino
for toeach
student.
As
an
example
ofbasics
dynamical
interesting
anpaper
individual
learner.
Specifically,
anmake
approach
ofAs
learning
by
doing
is applied
when
using
a
Arduino
architecture
for each
student.
an
of
dynamical
interesting
for
an
individual
learner.
Specifically,
an advantage
approach
learning
by doing
is applied
when
using
a low-cost
low-cost
Arduino
each
student.of
an example
example
of support
dynamical
systems
simple
RLC-circuits
havearchitecture
been
chosen.forThe
ofAs
Matlab/Simulink
of
systems
simple
RLC-circuits
havearchitecture
been chosen.forThe
advantage
Matlab/Simulink
support
of
when
using
a low-cost
Arduino
each
student.of
As
an
example
of
dynamical
Arduino
platform
has
enabled
students
to
perform
programming
tasks
from
known
environment.
systems
simple
RLC-circuits
have
been
chosen.
The
advantage
of
Matlab/Simulink
support
of
Arduino simple
platform
has enabledhave
students
to perform
programming
tasks
from known environment.
systems
RLC-circuits
been
advantage
Matlab/Simulink
support
of
This paper
concentrates
on a limited
part
of the The
control
theory, of
namely
the static environment.
and
dynamic
Arduino
platform
has enabled
students
tochosen.
perform
programming
tasks
from
This
paper
concentrates
on
a
limited
part
of
the
control
theory,
namely
theknown
static environment.
and dynamic
Arduino
platform
has
enabled
students
to
perform
programming
tasks
from
known
characteristics.
Particularly,
in
this part
paperof we
will
present
how
to construct
different
RLC
This
paper concentrates
on a in
limited
the will
control
theory,
namely
the staticdifferent
and dynamic
characteristics.
Particularly,
this
paper
present
how
to
construct
RLC
This
paper
concentrates
oncharacteristics:
a in
limited
of we
the will
control
theory,
namely
the
staticdifferent
andfrequency
dynamic
characteristics.
Particularly,
this part
paperstatic
we
present
how
to
construct
RLC
circuits,
measure
following
I/O
characteristic,
step,
impulse
and
circuits,
measure
following
characteristics:
static
I/O
characteristic,
step,
impulse
and
frequency
characteristics.
Particularly,
in this paper we will present how to construct different RLC
responses
and
their
parameters.
circuits,
following
responsesmeasure
and identify
identify
theircharacteristics:
parameters. static I/O characteristic, step, impulse and frequency
circuits,
following
responsesmeasure
and identify
theircharacteristics:
parameters. static I/O characteristic, step, impulse and frequency
© 2019, IFAC
(International
Federation
of Automatic Control) Hosting by Elsevier Ltd. All rights reserved.
responses
and
identify
their
parameters.
Keywords:
control
theory,
learning
by doing,
doing, RLC
RLC circuits,
circuits, static
static and
and dynamical
dynamical
Keywords: control
theory,
learning
by
characteristics,
microcontroller
Arduino
UNO
Keywords:
control
theory,
learning
by
doing,
RLC
circuits,
static
and
dynamical
characteristics,
microcontroller
Arduino
UNO
Keywords:
control
theory, learning
by doing,
characteristics,
microcontroller
Arduino
UNORLC circuits, static and dynamical
characteristics, microcontroller Arduino UNO
1.
an
1. INTRODUCTION
INTRODUCTION
an expensive
expensive measurement
measurement card
card (Huba
(Huba and
and Huba,
Huba, 2015;
2015;
an
expensive
measurement
card et
(Huba
and Takács
Huba, et
2015;
Huba
and
Halás,
2011;
Malatinec
al.,
2014;
al.,
1. INTRODUCTION
Huba
and
Halás,
2011;
Malatinec
et
al.,
2014;
Takács
et
al.,
1.
INTRODUCTION
an
expensive
measurement
card
(Huba
and
Huba,
2015;
2019).
There
exist
also
microcontroller
based
open
source
Control
theory
belongs
to
exciting
fields
of
study
but
many
Huba
and
Halás,
2011;
Malatinec
et
al.,
2014;
Takács
et
al.,
There
exist
also
microcontroller
based
open
source
Control theory belongs to exciting fields of study but many 2019).
and
Halás,
2011;
Malatinec
al., 2014;
Takács
etany
al.,
hardware
solutions
that
can be et
downloaded
free by
studentstheory
see it like
continuation
of fields
mathematics
with
a lot Huba
2019).
There
exist
also
microcontroller
based
open
source
Control
belongs
to
exciting
of
study
but
many
hardware
solutions
that
can
be
downloaded
free
by
any
students
see
it
like
continuation
of
mathematics
with
aa lot
2019).
There
exist
also
microcontroller
based
open
source
Control
theory
belongs
to
exciting
fields
of
study
but
many
hardware
solutions
that
can
be
downloaded
free
by
any
institution
and
used
for
low-cost
production
of
desired
students
see
it
like
continuation
of
mathematics
with
lot
of formulas and derivations. In fact, it is a kind of applied institution and used for low-cost production of desired
of
formulas
derivations.
In
fact,
it
is
a
applied
solutions
be downloaded
free
by any
students
seeand
itbut
like
continuation
of mathematics
with
a lot hardware
amount
equipment
(Takács,
of
formulas
and
derivations.
In
fact,
it
is students
a kind
kind of
of
applied
mathematics
in
order
to
attract
the
we
have
andlaboratory
usedthat
for can
low-cost
production
of desired
amount of
of the
the
(Takács, 2019).
2019).
mathematics
but
in
order
to
attract
the
students
we
have institution
andlaboratory
used for equipment
low-cost production
of desired
of
and
derivations.
In
is students
athey
kindwill
of we
applied
to formulas
present the
control
theory
infact,
the it
way
see
its institution
amount
of
the
laboratory
equipment
(Takács,
2019).
mathematics
but
in
order
to
attract
the
have
in learning equipment
of control theory presented
to present thebut
control
theory
in the the
waystudents
they willwesee
its The approach
of the laboratory
2019). in
mathematics
inapplications
order
to attract
have
sense
in practical
from
the they
very will
beginning,
The approach
in learning of control (Takács,
theory presented
in
to
present
the control
theory
infrom
the way
see
its amount
this
paper
is
a
little
bit
different.
It
also
relies
sense
in
practical
applications
the
very
beginning,
The
approach
in
learning
of
control
theory
presented
in
to
present
the control
theory infrom
thedevelopment
way
see an
its this paper is a little bit different. It also relies on
on technotechnosense
in practical
applications
the they
very will
beginning,
especially
when
the
technological
offers
The
approach
in
learning
of
control
theory
presented
in
logical
development
in
the
field
of
microcomputers
but
especially
when
the
technological
development
offers
an
this
paper
is
a
little
bit
different.
It
also
relies
on
technosense
in practical
applications
from
the very beginning,
development
in
the
field ofItmicrocomputers
but it
it
especially
when
the
technological
development
offers an logical
environment
for
low-cost
solutions.
this
paper
is
a
little
bit
different.
also
relies
on
technoenvironment
for
low-cost
solutions.
offers
aadevelopment
possibility
to
student
to
build
his/her
own
inevery
the field
of microcomputers
but
it
especially
when
the technological
development offers an logical
offers
possibility
to
every
student
to
build
his/her
own
environment
for
low-cost
solutions.
logicaladevelopment
the field
of microcomputers
but
it
offers
possibility equipment
toinevery
student
to build
own
laboratory
represented
by
aahis/her
basic
elecIt was not always
true solutions.
several decades ago. This was simple
environment
for
low-cost
simple
laboratory
equipment
represented
by
basic
elecIt
was
not
always
true
several
decades
ago.
This
was
offers
acircuit
possibility
to every student
tothe
build
his/her
own
trical
and
connected
through
microcontroller
It
was
not
always
true
several
decades
ago.
This
was
the
time
when
computers
were
not
accessible
and
the
simple
laboratory
equipment
represented
by
a
basic
eleccircuit
and connected
through
the by
microcontroller
thewas
time when
computers
were not accessible
and the trical
laboratory
equipment
represented
a basic
elecIt
always
true everything
several
ago.
This
to his/her
laptop.
In education
this approach
is usually
students
had
to calculate
by accessible
hand.
Experiments
trical
circuit
and connected
through
the microcontroller
the
timenot
when
computers
were decades
not
and was
the simple
to
his/her
laptop.
In
education
this
approach
is usually
students
had
to
calculate
everything
by
hand.
Experiments
trical
circuit
and
connected
through
the
microcontroller
the
time
when
computers
were
not
accessible
and
the
classified
learning
by
doing.
could have
been
performed
with anbyexpensive
measure- to
his/heras
laptop.
approach is usually
students
hadbeen
to calculate
everything
hand. Experiments
classified
learningIn
byeducation
doing. this
could
have
performed
with
an
measurehis/heras
students
hadbeen
to calculate
everything
hand.
Experiments
classified
aslaptop.
learningInbyeducation
doing. this approach is usually
could
have
performed
with
anbyexpensive
expensive
measurement apparatus,
usually
for
big
groups
of students.
Later, to
paper
on
ment apparatus,
usually
for big
groups
of students.
Later, This
classified
as concentrates
learning by doing.
could
have of
been usually
performed
with
an
expensive
measurepaper
concentrates
on aa limited
limited part
part of
of the
the control
control
the
computers
allowed
to
ment
apparatus,
for big
groups
of students.
Later, This
the period
period
of personal
personal
computers
allowed
to individualindividualtheory,
namely
the
static
and
dynamic
characteristics.
The
This
paper
concentrates
on
a
limited
part
of
the control
ment
apparatus,
usually
for
big
groups
of
students.
Later,
namely
the
static
and
dynamic
characteristics.
The
ize learning.
With
the simulation
software toreleases
(e.g. theory,
the
period
of
personal
computers
allowed
individualThis
paper
concentrates
on adynamic
limited
part
of the
control
theory,
namely
the
static and
characteristics.
The
Arduino
Uno
has
been
chosen
because
of
ize learning.
With
the simulation
software toreleases
(e.g. microcontroller
the
period
of
personal
computers
allowed
individualmicrocontroller
Arduino
Uno
has
been
chosen
because
of
Matlab,
Scilab,
Modelica,
Octave) software
the students
could
at theory, namely the static and dynamic characteristics. The
ize
learning.
With
the
simulation
releases
(e.g.
its
widespread
adoption,
Matlab
and
community
support,
Matlab,
Scilab,
Modelica,
Octave)
the
students
could
at
microcontroller
Arduino
Uno
has
been
chosen
because
of
ize
learning.
With
the simulation
software
releases
(e.g.
its
widespread
adoption,
Matlab
and
community
support,
Matlab,
Scilab,
Modelica,
Octave)
the
students
could
at
least
verify
results
calculated
by
hand.
The
prices
of
exmicrocontroller
Arduino
Uno
hasand
been
chosen
because
of
least
verify
results
calculated
by
hand.
The
prices
of
exand
of
course,
its
price.
In
literature
one
can
find
several
its
widespread
adoption,
Matlab
community
support,
Matlab,
Scilab,
Modelica,
Octave)
the
students
could
at and of course, its price. In literature one can find several
periments
were
decreasing
but
not
enough
to
be
at
least
verify
results
calculated
bystill
hand.
The
prices
of
exits
widespread
adoption,
Matlab
and
community
support,
periments
were
decreasing
but
still
not
enough
to
be
at
and
of
course,
its
price.
In
literature
one
can
find
several
expamples when the microcontroller Arduino Uno has
least
verify
calculated
hand.
prices
exdisposal
for results
each student
during
his/her
exercises.
The
when
the
microcontroller
Arduino
Uno
has
periments
butbystill
not The
enough
to of
beThe
at expamples
and
ofused
course,
its price.
In literature
one
can
find
several
expamples
when
the purposes
microcontroller
Arduino
Uno
has
been
for
similar
(Suwondo
and
Sulisworo,
disposal forwere
eachdecreasing
student during
his/her
exercises.
periments
were
decreasing
but
still
not
enough
to
be
at
been
used
for
similar
purposes
(Suwondo
and
Sulisworo,
experimentation
part
of study
has his/her
been enabled
for work
disposal
for
each
student
during
exercises.
The
expamples
when
the purposes
microcontroller
Arduino
Uno
has
2017;
Weis,
2014;
Messner
et
al.,
2017).
Particularly,
in
this
experimentation
part
of
study
has
been
enabled
for
work
been
used
for
similar
(Suwondo
and
Sulisworo,
disposal
for
eachpart
student
during
his/her
exercises.
The 2017; Weis, 2014; Messner et al., 2017). Particularly, in this
experimentation
of study
has
been enabled
for
work
in
small
groups
or
sharing
the
equipment
for
a
limited
been
used
for
similar
purposes
(Suwondo
and Sulisworo,
in
small
groups
or
sharing
the
equipment
for
a
limited
paper
we
will
present
learning
by
doing
methodology
how
2017;
Weis,
2014;
Messner
et
al.,
2017).
Particularly,
in
this
experimentation
part
of study
beenhas
enabled
for
work paper we will present learning by doing methodology how
time.
The
different
method
in
small
or progressive
sharing
thehas
equipment
for aprovided
limited
2017;
Weis,
2014;
Messner
etcircuits
al.,by2017).
Particularly,
in how
this
time.
Thegroups
different
progressive
method
has been
been
provided
paper
we will
present
learning
doing
methodology
to construct
different
RLC
and
following
in
groups
or progressive
sharing
themethod
equipment
for aprovided
limited
construct
RLC
circuits
and measure
measure
following
by small
building
remote
laboratories
when has
the been
students
have to
time.
The
different
paper
we willdifferent
present
learning
by doing
methodology
how
to
construct
different
RLC
circuits
and
measure
following
characteristics:
static
I/O
characteristic,
step,
impulse
by
building
remote
laboratories
when
the
students
have
time.
Thethe
different
progressive
has
provided
static RLC
I/O circuits
characteristic,
step, following
impulse
accessed
real equipment
viamethod
the
Internet
(Sáenz
ethave
al., characteristics:
by
building
remote
laboratories
when
the been
students
to
different
and measure
andconstruct
frequency
responses.
also discuss
advanteges
and
accessed
the
real
equipment
via
the
Internet
(Sáenz
et
al.,
characteristics:
static I/OWe
characteristic,
step, impulse
by
building
remote
laboratories
when
the students
have
accessed
the
real
equipment
via
the
Internet
(Sáenz
et
al.,
2015;
Kalúz
et
al.,
2015;
Bosak
and
Zakova,
2015).
and
frequency
responses.
We
also
discuss
advanteges
and
characteristics:
static
I/OWecharacteristic,
step, impulse
2015;
Kalúz
et
al.,
2015;
Bosak
and
Zakova,
2015).
limitations
of
such
an
approach
from
the
pedagogical
view.
and
frequency
responses.
also
discuss
advanteges
and
accessed
the et
real
equipment
via and
the Internet
(Sáenz
et al., limitations of such an approach from the pedagogical view.
2015;
Kalúz
al.,
2015;
Bosak
Zakova,
2015).
frequency
responses.
We also
discuss
advantegesview.
and
limitations
of such
an approach
from
the pedagogical
Nowadays
the
cost2015;
of simple
laboratory
equipment
for and
2015;
Kalúz
et
al.,
Bosak
and
Zakova,
2015).
The
contentof of
theanpaper
is structured
as follows. After
Nowadays
the
cost
of
simple
laboratory
equipment
for
limitations
such
approach
from the pedagogical
view.
Nowadays
the
cost
of
simple
laboratory
equipment
for
demonstration
of
basic
principles
of
control
theory
deThe
content
of
the
paper
is
structured
as
follows.
After
demonstration
of
basic
principles
of control
theory dethe
Introduction
chapter
chapter
describes
the
content of the
paperthe
is second
structured
as follows.
After
Nowadays
the of
cost
of simple
equipment
for The
the
Introduction
chapter
chapter
describes
the
creased rapidly
thanks
to
the laboratory
implementation
of microdemonstration
basic
principles
of control
theory
deThe
content of the
paperthe
is second
structured
ascircuit
follows.
After
the
Introduction
chapter
the
second
chapter
describes
the
microcontroller
in
combination
with
RC
and
its
creased
rapidly
thanks
to
the
implementation
of microdemonstration
of
basic
principles
of
control
theory
demicrocontroller
in
combination
with
RC
circuit
and
its
controllers.
Thisthanks
kind of
equipment
(e.g. thermo-optocreased
rapidly
to
the
implementation
of
microthe Introduction
chapter
the
second
chapter
describes
the
possible
usage
within
the
Matlab/Simulink
environment.
controllers.
This
kind
of
equipment
(e.g.
thermo-optomicrocontroller
in
combination
with
RC
circuit
and
its
creased
rapidly
to equipment
thesystem,
implementation
of micro- possible usage within the Matlab/Simulink environment.
controllers.
Thisthanks
kind
of
(e.g. thermo-optomechanical
system,
hydraulic
magnetic
levitation
microcontroller
in
combination
with
RC
circuit
and
its
The
next
chapter
presents
the
static
and
dynamic
remechanical
system,
hydraulic
system,
magnetic
levitation
possible
usage
within
the
Matlab/Simulink
environment.
controllers.
This
kind
of equipment
(e.g.
thermo-optoThe
nextusage
chapter
presents
the static and environment.
dynamic remechanical
system,
hydraulic
system, to
magnetic
levitation
system,
etc.)
uses
the
USB
interface
be
connected
dipossible
within
the
Matlab/Simulink
system,
etc.)
uses
the
USB
interface
to
be
connected
disponses.
Arduino
and Matlab
codeand
are dynamic
included reas
The
nextThe
chapter
presents
the static
mechanical
hydraulic
system,
magnetic
levitation
rectly to thesystem,
students’
laptops
without
necessity
to buy
The
Arduino
and
Matlab
code
are
included
as
system,
the
USB
interface
to
be
connected
di- sponses.
The
next
chapter
presents
the static
dynamic
responses.
The
Arduino
and
Matlab
codeand
are
included
as
well
as
graphical
outputs
of
measurements.
In
Conclusion
rectly toetc.)
the uses
students’
laptops
without
necessity
to buy
system,
etc.)
uses
the
USB
interface
to
be
connected
diwell
as
graphical
outputs
of
measurements.
In
Conclusion
rectly
to
the
students’
laptops
without
necessity
to
buy
This work
sponses.
The
Arduino
and
Matlab
code
are
included
as
has been partially supported by the grants APVV SK
well
as
graphical
outputs
of
measurements.
In
Conclusion
This work
hasstudents’
been partially
supported
by thenecessity
grants APVV
SKrectly
to the
laptops
without
to buy
This work hasand
IL-RD-18-0008
VEGA
1/0745/19.
well as graphical outputs of measurements. In Conclusion
been
partially
supported by the grants APVV SKIL-RD-18-0008 and
VEGA
1/0745/19.
IL-RD-18-0008 and VEGA 1/0745/19.
This work hasand
been
partially
supported by the grants APVV SKIL-RD-18-0008
VEGA
1/0745/19.
IL-RD-18-0008
andIFAC
VEGA
1/0745/19. Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved.
2405-8963 © 2019,
(International
Peer review under responsibility of International Federation of Automatic Control.
10.1016/j.ifacol.2019.12.759
218
Pavol Bisták / IFAC PapersOnLine 52-27 (2019) 217–221
Fig. 2. RC circuit
Fig. 1. Arduino Uno board and digital-analog converter
MCP4725
chapter the results are evaluated and further development
/ modification possibilities are discussed.
2. ARDUINO UNO - LOW-COST
MICROCONTROLLER PLATFORM
This paper is oriented to teaching the control theory basics
using learning by doing methodology. The choice of a lowcost microcontroller platform corresponds to this purpose.
Although there are several possibilities (e.g. STM, TI) the
choice of Arduino Uno has been obvious when taking into
account its popularity, support and price. Arduino Uno R3
uses the 8-bit microcontroller ATmega328P that is placed
on the development board equipped with input/output
(I/O) pins, connectors (USB, power) and other necessary
components for operation of microcontroller (Fig. 1). For
our purposes it is important that Arduino Uno has analog
inputs (6) for signal measurements and digital I/O pins
(14) from which 6 pins support PWM signals. Arduino
Uno does not have any analog outputs therefore to produce
wave signals for frequency characteristics we will have to
use an additional board that will serve as a digital-analog
converter (12-bit MCP4725). The board of Arduino can
be powered also by the USB cable.
From the family of RLC-circuits as an introductory dynamical system the RC-circuit has been chosen. It consists just from two passive electrical components, i.e. the
resistor and the capacitor as depicted in the Fig. 2. Even
students that have no practical experiments with building
electrical circuits should be able to construct such an easy
circuit by connecting these basic elements with wires on
a breadboard. The physical connections of the RC-circuit
with the Arduino Uno microcontroller can be seen from the
Fig. 3. One can be confused of so many wires but this is
caused as a consequence of using D/A converter. Even this
converter is effectively activated through I2C it still has six
ports to be connected. Basically, the RC circuit is powered
from the D9 pin of Arduino. Only in the case of frequency
responses the RC circuit is alternatively powered from the
output of the D/A converter. The output of the system
represented by the voltage on the capacitor is measured
using the A0 pin of the Arduino that serves as an 10-bit
analog-digital converter. The measurements were carried
out with the following numerical values of the electrical
components: R = 4700Ω, C = 3, 3µF .
To program the Aruduino boards we can use several
tools from which the Arduino Integrated Development
Environment (IDE) is the most known (Fig. 6). This
Fig. 3. RC circuit with Arduino and D/A converter in
Fritzing
enables to write the code for Arduino in the language
very similar to the C++ programming language. But
programming language for Arduino is not limited to C++.
You can use well-known languages as Python, Java, C#
and also the Matlab/Simulink in which we are the most
interested because this is the language for most of the
control theory courses. In fact, we will combine C++
programming in Arduino IDE with Matlab programming.
Arduino will send measured data to the Matlab where this
will be visualized and identified.
3. MEASUREMENT OF BASIC CHARACTERISTICS
OF DYNAMICAL SYSTEMS
After the students have built the simple real RC circuit,
connect it to the Arduino Uno board (4) and install all
necessary software (Arduino IDE and Matlab) they can
proceed with the measurement of basic characteristics of
such a system. In the following sections we will describe
how Arduino can be used for measurement of input-output
characteristic, step and frequency responses.
3.1 Input-output characteristic of RC circuit
Although the input-output characteristic does not provide
us with the information about the dynamics of the circuit
it still belongs to the most important information in the
control theory. It allow us to identify the gain of the system
as a ratio of steady-state output to the constant input.
By measurement at different inputs we can identify if the
system is linear or nonlinear one. The gain parameter and
the linearity of the system play crucial role in the control
Pavol Bisták / IFAC PapersOnLine 52-27 (2019) 217–221
219
Fig. 4. Real RC circuit connected to Arduino and D/A
converter
Input-output response
5
4.5
4
3.5
Vout [V]
3
Measured
Simulated
2.5
2
1.5
Fig. 6. Code from Arduino IDE for performing inputoutput characteristics
1
0.5
0
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
Vin [V]
Fig. 5. Input-output characteristics of RC circuit
after collection all data starts to plot them. The resulting
I/O characteristic is depicted in the Fig. 5 where it is
visible that in this case there is no big difference between
the measured and simulated characteristics.
theory and therefore it is important to let students work
with a real systems from the very beginning.
3.2 Step response of RC circuit
The RC circuit is the simple one and therefore it is suitable
for beginner in the control theory. In the Fig. 5 they can
see the linear input-output characteristic corresponding
to the RC circuit. From this example students can not
only identify the linearity of the system but calculate the
gain of the system as well when they express the quotient
of the linear relation. It determines the slope of the I/O
characteristic also visible from the plot in the Fig. 5.
After knowing the gain of the system, students would like
to investigate the dynamics of the RC circuit. The step
response is the first dynamic characteristic that shows the
behavior in relation with time. In this simple example
this corresponds to the identification of the time constant
of the RC circuit. From the theory we know that the
time constant of the first order dynamical system can be
calculated using step response from the time when the
output reaches the 63% of the steady-state value.
The question is what students have to do in order to
be able to measure such characteristics. The must write
to short programs. One for Arduino and another one for
Matlab. At this stage they should already know the basics
of the C-language and therefore it could not be difficult for
them to understand or modify the code that is displayed
in the Fig. 6. They should also be familiar with Matlab
to have possibility to customize the code presented in the
Fig. 7. Both software use serial communication. In fact,
Matlab waits until it starts receiving message. Arduino
measures the real data and sends it to the Matlab that
To program the measurement of the step response there
is no big difference in comparison with the measurement
of I/O characteristic. In comparision with the previous
case now Arduino sends to Matlab two values: output and
time. We do not present the Arduino and Matlab codes
here. But the resulting step response can be found in the
Fig. 8. As in the I/O characteristic also here the measured
and simulated step response do not differ significantly. Of
course, one can mention that the real data are influenced
by a small noise. After finishing this experiment students
Pavol Bisták / IFAC PapersOnLine 52-27 (2019) 217–221
220
0
Amplitude frequency response
-2
Gain [dB]
-4
Measured
Simulated
-6
-8
-10
-12
-14
10-1
100
101
102
Frequency [Hz]
Fig. 9. Amplitude frequency responses of RC circuit
3.3 Frequency response of RC circuit
To measure the frequency characteristics with the only
help of Arduino Uno is not so easy task as the previous
ones. Here the limits of Arduino as a low-cost platform
are apparent. The main problem is caused by the lack of
a harmonic signal generator. Arduino itself is not able to
produce sinusoidal signal with higher frequency. Although
we extended the Arduino with D/A converter and the
sinusoidal values have been pre-calculated and stored in
tables we were able to measure frequency responses up to
50 Hz. The measurement was not precise and this time the
differences between the measured and simulated response
are significant (Fig. 9).
Fig. 7. Matlab code for performing input-output characteristics
4. CONCLUSIONS
Step response
5
Measured
Simulated
4.5
Output voltage Vout [V]
4
3.5
3
2.5
2
1.5
1
0.5
0
500
510
520
530
540
550
560
Although this activity could be for students the most
difficult one in comparison with the previous cases we
recommend to let student measure also the frequency
responses at least in a few points because this topic of
the control theory study is usually not well understood.
570
580
590
600
Time [ms]
Fig. 8. Step responses of RC circuit
should know the gain of the system and also its time
constant. So they can continue with advance topics. They
can start to design simple controllers or they can continue
with measurement of frequency responses.
In order to provide each student with the equipment for
experimentation, in this paper we focused to the usage of
the Arduino Uno platform for the measurement of static
and dynamic characteristics of dynamical systems. Arduino is able to communicate through the serial interface
with Matlab that serves for comfortable visualization and
archiving of the measured data. The students are engaged
in the learning process when they have to build their
own circuits and program microcontrollers to measure the
characteristics. Their work could be personalized because
Arduino low-costs platform is accessible for everyone. We
have presented precise measurement in the case of I/O
and step characteristics but we have also mentioned the
disadvantages of the low-cost platform when measuring
the frequency responses. For the future we will try not to
replace the Arduino by expensive signal generators and
scopes but find cheap solutions using electronic oscilators
and a little bit powerful types of microcontrollers.
REFERENCES
T. Bosak and K. Zakova. Node.js based remote control of
thermo-optical plant. Proceedings of 2015 12th Interna-
Pavol Bisták / IFAC PapersOnLine 52-27 (2019) 217–221
tional Conference on Remote Engineering and Virtual
Instrumentation, REV 2015, pages 209–213, 2015.
M. Huba and M. Halás. Hydraulic plants for face-to-face
training and remote experiments. ICETA 2011 - 9th
IEEE International Conference on Emerging eLearning
Technologies and Applications, Proceedings, pages 79–
81, 2011. doi: 10.1109/ICETA.2011.6112590.
T. Huba and M. Huba.
Experimenting with a
nonlinear thermo-opto-mechanical system TOM1A.
IFAC-PapersOnLine, 48(29):188–193, 2015.
doi:
10.1016/j.ifacol.2015.11.235.
M. Kalúz, J. Garcı́a-Zubı́a, M. Fikar, and L. Čirka.
A flexible and configurable architecture for automatic control remote laboratories. IEEE Transactions
on Learning Technologies, 8(3):299–310, 2015. doi:
10.1109/TLT.2015.2389251.
T. Malatinec, V. Popelka, M. Huba, and P. Hudačko. Laboratory model helicopter control using a lowcost arduino
hardware. Proceedings of the 2014 15th International
Carpathian Control Conference, ICCC 2014, pages 326–
331, 2014. doi: 10.1109/CarpathianCC.2014.6843621.
B. Messner, R. Hill, and JD. Taylor.
Control Tutorials for Matlab and Simulink Activity 2 Part (a): Time-Response of an
Inductor–Resistor–Capacitor
(LRC)
Circuit.
http://ctms.engin.umich.edu/CTMS/index.php?
aux=Activities LRCcircuitA, 2017.
Accessed:
2019-5-23.
J. Sáenz, J. Chacón, L. De La Torre, A. Visioli, and
S. Dormido. Open and low-cost virtual and remote labs
on control engineering. IEEE Access, 3:805–814, 2015.
doi: 10.1109/ACCESS.2015.2442613.
N. Suwondo and D. Sulisworo. Hands-on Learning Activity Using an Apparatus for Transient Phenomena
in RC Circuit Based on Arduino UNO R3-LINXLabview. iJOE International Journal of Online and
Biomedical Engineering, 13(1):116–124, 2017.
doi:
10.3991/ijoe.v13i01.6317.
G. Takács. AutomationShield - Control Systems Engineering Education. www.automationshield.com, 2019.
Accessed: 2019-09-24.
G. Takács, T. Konkoly, and M. Gulan. Optoshield: A
low-cost tool for control and mechatronics education.
2019 12th Asian Control Conference, ASCC 2019, pages
1001–1006, 2019.
S. Weis. Using an arduino to measure frequency response
and current-voltage device characteristics in electronics
labs. Proceedings of the 2014 ASEE Gulf-Southwest
Conference, New Orleans, Louisiana, USA, 2014.
221
Download