Implementing A Level Control System in Labview
Implementing A Level Control System in Labview
Lab Project
Faculty of Technology, Postboks 203, Kjølnes ring 56, N-3901 Porsgrunn, Norway. Tel: +47 35 57 50 00 Fax: +47 35 57 54 01
Table
of
Contents
Table
of
Contents
.......................................................................................................................
ii
ii
A
very
simple
(linear)
model
of
the
water
tank
may
be
as
follows:
1
ℎ= 𝐾 𝑢−𝐹!"#
𝐴 !
Where:
3
4
Modeling
and
Simulation
1
ℎ= 𝐾 𝑢 − 𝐾! ℎ
𝐴 !
where
𝐾!
is
the
valve
gain
on
the
outflow.
𝐾! 𝐾!
ℎ=− ℎ+ 𝑢
𝐴 𝐴
(The
general
term
is
𝑥 = 𝑎𝑥 + 𝑏𝑢)
1 𝜌𝑔ℎ
ℎ= 𝐾! 𝑢 − 𝐾!
𝐴 𝐺
Ch. 8 “Prosessdynamikk”
The
model
should
be
implemented
using
the
blocks
(Integrator,
Summation,
Multiplication,
etc.)
from
the
Simulation
palette
in
LabVIEW:
Implement
the
model
using
the
Control
and
Simulation
Loop.
Test
the
model
using
a
step
response.
1
ℎ= 𝐾 𝑢−𝐹!"#
𝐴 !
The
following
values
can
be
used
in
the
simulations:
𝐾! = 15(𝑐𝑚! /𝑠)/𝑉
A = 80𝑐𝑚!
𝑇! = 0.1𝑠
You may also want to try the following model (voluntary):
1
ℎ= 𝐾 𝑢 − 𝐾! ℎ
𝐴 !
Discuss
the
results
for
the
different
models.
When
the
system
works
as
expected,
implement
the
model
as
a
Simulation
Subsystem
and
use
it
within
a
While
Loop.
A typical control system in LabVIEW can be developed as follows:
Where
we
use
feedback
control
(PID)
in
order
to
control
the
system
to
make
sure
the
output
of
the
system
stays
on
the
reference
value.
6
7
Control
System
Simulation
Find
proper
PID
parameters.
Make
sure
the
control
system
can
handle
changes
in
the
reference
as
well
as
changes
in
the
outflow.
Make
sure
to
create
a
user-‐friedly
Front
Panel
(HMI).
The
HMI
should
consist
a
simulation
of
the
water
tank,
it
should
be
possible
to
change
PID
parameters,
etc.
The
HMI
should
include
a
Chart
with
both
the
Level
(ℎ)
and
the
Reference
signal
and
another
Chart
showing
the
Control
Signal
(𝑢)
It
should
also
be
possible
to
change
the
flow
out
of
the
tank
(𝐹!"# )
from
the
HMI
in
order
to
see
if
the
controller
can
handle
changes
in
the
outflow.
Use a While Loop in order to implement your Control System.
Where u is the controller output and e is the control error:
𝑒 𝑡 = 𝑟 𝑡 − 𝑦(𝑡)
Create
a
discrete
PI
controller
in
LabVIEW
using
the
Formula
Node.
Create
a
SubVI
of
the
code.
Below we see an example of the Formula Node in LabVIEW:
Compare
the
results
from
one
of
the
built-‐in
PID
controllers
with
the
results
from
the
PI
controller
created
from
scratch.
Here
you
will
control
the
system
using
a
standard
PID
controller
together
with
a
Feedforward
controller
in
order
improve
the
control
of
the
system.
The
total
control
signal
then
becomes:
𝑢 = 𝑢!"# + 𝑢!!
Start
by
creating
a
standard
block
diagram
(pen
&
paper)
of
your
system
with
PID
controller,
Feedforward
controller,
process.,
etc.
(This
block
diagram
should
be
part
of
the
HMI)
1
ℎ= 𝐾 𝑢−𝐹!"#
𝐴 !
In
this
model
is
𝐹!"#
a
noise
signal/disturbance
that
we
want
to
remove
by
using
Feedforward.
We want to design the Feedforward controller so that 𝐹!"# is eliminated.
Tip!
-‐
We
solve
for
the
control
variable
𝑢
(replace
𝑢
with
𝑢! ),
and
substituting
the
process
output
variable
ℎ
by
its
setpoint
ℎ!" .
-‐ We also assume that the setpoint is constant, i.e. ℎ!" = 0.
Implementation:
Does
the
feedforward
control
improve
the
level
control
(compare
with
not
using
feedforward
control,
i.e.,
only
using
feedback
control)?
You
should
make
it
possible
to
turn
the
feedforward
controller
on/off
from
the
Front
Panel
so
we
can
easly
switch
between
using
only
pid
or
pid
+
feedforward.
You
find
more
information
about
the
LM-‐900
Level
Tank
here:
http://home.hit.no/~hansha/?equipment=leveltank
10
11
Apply
on
the
Real
Process
The
real
process
is
noisy,
so
it
is
recommended
that
you
implement
and
use
a
Lowpass
Filter/Measurement
Filter.
Since
we
shall
implement
the
Measurement
Filter
in
a
computer,
we
need
to
make
a
dicrete
version
of
the
filter.
We
use
the
Euler
Backward
discretization
method:
𝑥(𝑡! ) − 𝑥(𝑡!!! )
𝑥≈
𝑇!
This gives:
𝑇! 𝑇!
𝑦!" (𝑡! ) = 𝑦!" (𝑡!!! ) + 𝑦 (𝑡 )
𝑇! + 𝑇! 𝑇! + 𝑇! ! !
𝑇!
≡ 𝑎
𝑇! + 𝑇!
𝑇!
𝑎=
𝑇! + 𝑇!
This
discrete
Measurement
Filter
can
be
easily
implemented
in
a
computer
using
e.g.,
LabVIEW,
C#,
etc.
Golden rule:
𝑇!
𝑇! ≤
5
www.hit.no
E-‐mail: [email protected]
Blog: http://home.hit.no/~hansha/