Anda di halaman 1dari 4

2010 International Conference on Measuring Technology and Mechatronics Automation

Application of Real-time Control System Using LABVIEW in Distance-Learning

Jamal ELMERABETE, Hong Li, Youssef RAFI


Central South University, Changsha, Hunan, 410083, China
mrlog10@hotmail.com

Abstract—Engineering Sciences and education have always been real-time communication or fault-tolerance then next based or
dynamically interrelated with technology change, Educators and object oriented language are preferable.
researchers worldwide are using National Instruments products
to automate routine tasks, accomplish new objectives, replace III. REAL-TIME CONTROL
outdated and expensive equipment, and demonstrate students The notion of real-time implies that computer operations
the potential of high technology. Physical systems are modeled
rely on absolute and irreversible time. These operations are
and manipulated in software, and realized in hardware to
generally preformed accordingly with the evolution of a
demonstrate what differences may occur with real-life
applications. By solving control problems using software-based physical system. If necessary, the system-state is made
virtual instruments and actual hardware, students gain an available to the computer through appropriate interfacing
appreciation of the interaction of process instrumentation and devices, such as sensors and converters. The notion of real-
computers. Moreover, this practical activity can be carried out time control reinforces the original definition by specifically
at any time from anywhere to efficiently support automatic emphasizing actions carried out in addition to observations.
control study.
IV. FUNDAMENTALS OF PID CONTROLLER
Keywords-Real-time Control System;PID Controller; Typical controllers are implemented as numerical
LabVIEW;Distance Learning algorithms that are designed to compute, at every sampling
time tk=kh (where h is the sampling period and k is the sample
I. INTRODUCTION index), a correction factor u(k) which is added to the nominal
excitation of the controlled process. The nominal excitation is
Technical educational institutions are crunched between
a predefined signal based on a priori knowledge and issues to
demand for an effective education and budget constrains.
bring the process to desired operation conditions or to track
Their ability to deliver effective education can be greatly
given trajectories. The correction is necessary to both handle
enhanced by laboratories equipped with modern technologies
unexpected disturbances which affect the dynamic behavior of
including computer hardware and software capable to perform
the controlled process and to cope with the unavoidable
data acquisition, statistical data analysis, control experiments,
imprecision of the nominal excitation.
remote instrument control and network communication.
The most commonly used controller is called the PID. The
However, equipping a laboratory is a major expense and its
corresponding algorithm issues a correction according with
maintenance can be difficult. Teaching assistants are required
the time evolution of the actual error e(k) existing between the
to set up the laboratory, instruct in the laboratory, and grade
desired and the measured output of the controlled process,
laboratory reports. These time-consuming and costly tasks
respectively denoted yc(k) and y(k). the acronym PID is due to
result in relatively low laboratory equipment usage, especially
the way the correction is computed. The first term up(k) of the
considering that laboratories are available only when
correction is proportional (P) with the current error:
equipment and teaching assistants are both available.
This article will show how the fundamental concept of u P ( k ) = K P e( k )
Virtual Instrumentation directly translates to bottom-line The second term uI(k) takes into account the error history
benefits for the user. The interaction of instrumentation and in order to cancel out an eventual bias. To avoid the storage of
networked computers running graphical software reduces all previous samples, the past behavior is summarized using
manual data collection, analysis, storage, and transmission the integral (I) of the error signal. In the discrete case, the
tasks, allowing supplemental material to be covered by the integral can be evaluated in various ways. The method chosen
professor in the same time. is the sum of the trapezoidal areas obtained by linking the
successive error values (Figure1).
II. TEACHING REQUIREMENTS
From educational point of view, if control aspects are the
key element of the curricula, student are expected to design
control algorithms based on the mathematical model, simulate
how the controlled system works and then implement the
controller for the robot during the limited time of a regular
academic course. In this case integration of real-time
environment with rapid prototyping platforms such as
MATLAB/Simulink or LbaVIEW is essential.
If other topics of real-time control system must be
covered, for example, ask scheduling, resource management,

978-0-7695-3962-1/10 $26.00 © 2010 IEEE 663


DOI 10.1109/ICMTMA.2010.416
- get from the user the current PID parameters KP, TI
and TD, as well as the reference signal yc(k);
- compute the error e(k) = yc(k) – y(k) ( some filtering
can also be considered here);
- compute uP(k), uI(k), and uD(k) if applicable (the
states of the controller u(k-1) and e(k-1) have to be
available);
- compute the sum u(k) and limit its value in a range
compatible with the physical devices (power
amplifier, motor);
- Output the previously computed control signal u(k).
V. IMPLEMENTING PID LEVEL MEASUREMENT CONTROL
Figure 1. Time evolution of the error used by the PID controller
USING LABVIEW

1 ⎡ e(k ) + e(k − 1) ⎤ LabVIEW provides tools that could be used to display


u P (k ) = u I (k − 1) + K ⎥⎦ h (1) actual representation of measuring instrument such as a
TI ⎢⎣ 2 voltmeter. Graphical analysis and presentation/display are also
In addition, the correction has to take into account the available. For simplicity we present here a simple how to plot
speed of the error evolution. If the error varies quickly, the signals in charts. A chart is continuously updated by the most
correction has to be stronger to avoid overshoots. Such an recent signal values, and the x axis is typically the time axis. A
action is obtained by introducing a last term u D (k ) which is graph is a type of plots. Graphs plot any array versus any other
array in an XY (and the increment in the X array does not
proportional to the derivative (D) of the error signal computed have to be constant). There are several Graphs on the Graph
using the last two available samples. palette on the Functions palette, the most general being the
e(k ) − e(k − 1) XY Graph. The three arrays consisting of the historical values
u D ( k ) = K P TD (2) of the y, y_max, and y_min are plotted against one time array
h
containing the discrete times covering the elapsed time as the
Finally, u ( k ) = u P (k ) + u I ( k ) + u D ( k ) (3) VI was run. The Chart is updated once the While loop has
In equation 1, 2 and 3, the factors KP, TI and TD are the stopped (The VI also contains a Chart, which is continuously
tuning parameters defining the behavior of the closed-loop updated as the VI runs). Below are the Front panel and the
system. However, it is often sufficient to carry out a single Block diagram of graph.vi.
open-loop experiment on the physical system to be controlled
to get a convenient set of parameters. The idea is to apply a
step of level U as an excitation signal of the system (Figure2).

Figure 2. Step response of the system to be controlled.

The corresponding variation of the output provides the


slope a at the inflection point (or at infinity if the response
reaches no stationary value) and the time interval L between
the step and the crossing of the tangent at the inflection point
with the time axis. The convenient parameters are listed in
Table1, with respect to the results of the experiment and the
Figure 3. graph.vi.
desired controller type.
Controller KP KI TD
Comments to this VI: The XY Chart indicator is available on
P U/aL / /
PI 0.9U/aL 3.3L /
the Controls palette/Graph sub-palette. In the Block diagram
PID 1.2U/aL 2L 0.5L of graph.vi the XY Graph terminal is placed outside the While
Table1. Parameters of the P, PI or PID controller. loop. This is necessary since the Chart is to be updated once
The resulting sequence of operations which have to be the While loops has stopped. (The Chart terminal is however
implemented to complete the PID correction at time k is: placed inside the While loop since it is to be updated as the
- acquire the measurement y(k); While loop runs). The arrays of y, y_max, y_min and t are

664
generated in the respective tunnels on the right border of the based implementation, the laboratory enviroment can easily be
While loop. These tunnels are set to “Enable Indexing” (this is expanded for remote manipulation. The main concept in
set by right-clicking on the tunnel and selecting Enable turning the locally-controlled setup into a remotely-controlled
Indexing in the context menu). Bundle functions are used to one consists in moving the user interface away from the
bundle the t arry with the y array, the t array with the y_max experiment. Two distinctive parts result: the remote client and
array, and the t array with the y_mmin array. The output of a the local server.
Bundle function is a cluster. Then, these three clusters are
collected using a Build array function. The resulting array of
clusters of arrays is then wired to the XY Graph terminal.
VI. DISTANCE-LEARNING USING LABVIEW
Laboratories, which are found in all engineering and
science programs, are an essential part of the education
experience. Not only do laboratories demonstrate course
concepts and ideas, but they also bring the course theory alive
so students can see how unexpected events and natural
phenomena affect real-world measurements and control
algorithms. However, equipping a laboratory is a major
expense and its maintenance can be difficult. Teaching
assistants are required to set up the laboratory, instruct in the Figure 4. Architecture for carrying out real experiments in distance
laboratory, and grade laboratory reports. These time- learning.
consuming and costly tasks result in relatively low laboratory
equipment usage, especially considering that laboratories are Distancing the user from the local experiment while
available only when equipment and teaching assistants are keeping the same amount of benefits as local experimentation
both available. is a challenging, not only the same degree of interactivity must
be maintained, but the remote solution must also allow the
VII. DISTANCE-LEARNING REMOTE LABORATORIES user to “feel” the real experiment. During local
currently, traditional and virtual universities prpose on-line experimentation students can use their senses of vision and
courses based on electronic documents and multimedia hearing to perceive the effect of their acts on the control
presentations enriched with video and audio broadcasting. system. In a remote experimentation mode, this specification
While the students can take these classes from a remote is addressed by providing audio and video feedback
location they still have to come onto the compus for information in addition to the information given to the remote
laboratory practice. This restriction can be overcome by computer through the graphical user interface (GUI).
allowing students to access the laboratory facilities from a Obviously, such feedback needs to be given in a reasonable
distant location to carry out hands-on sessions. amount of time, minimizing the misleading (and most likely
The development of remote-experimentation facilities is also disturbing) effects of signal- transport delays. For
also motivated by the fact that the demand for access to example, a remote user will not find acceptable feedback that
laboratory facilities is growing rapidly in all engineering arrives 30 seconds after an action has been accomplished,
colleges. At the same time, the number of students is while the local response is achieved in fractions of a second.
increasing while the allocated laboratory resources do not Consequently, fast system responsiveness is a key goal in all
keep pace with this change. Being able to make the laboratory developments for remote experimentation. As might be
infrastructure accessible as virtual laboratories, available 24 expected, ideal instantaneous response times should still be
hours a day and 7 days a week, goes a long way towards minimized.
addressing these difficulties, and would also contribute to
lowering the costs of operating the laboratory in the long term. VIII. USING LABVIEW WITH TCP/IP
Moreover, students are able to carry out experimentation at Internet protocol (IP), User Datagram Protocol (UDP), and
the percise stage in their learning process when they need to Transmission Control Protocol (TCP) are basic tools for
compare their knowledge to reality. This is an additional network communication. The name TCP/IP comes from two
benefit of such a new paradigm introduced in distance of the best-known protocols of the Internet protocol suite, the
learning. The increased availability is obtained by allowing Transmission Control Protocol and the Internet Protocol.
students to reach the laboratory facilites via the Internet using
a modem, or from other points of nework access, such as
computers available at different campus locations. The
Internet offers many advantages over other technologies,
which makes it the medium of choice, the first advantage is its
price and availability, in a remote experimentation, not only
the users may be distributed all over the world, the Figure 5. TCP/IP communication
experiments can also be dstributed among the potential users
(such as universities) thus giving an opportunity to reduce the Because anyone can initiate a connection to a server, you
costs associated with laboratory facilities by sharing unique or might want server access control. The following block
expensive equipement. The learning envirement is based on a diagram shows how the server uses the remote address output
client/server architecture (Figure4). Given its fully computer-

665
value of the TCP Listen VI to determine whether a remote
client has permission to access the server.

Figure 6. Remote address output value of the TCP

IX. TRANSMISSION CONTROL PROTOCOL (TCP/IP) IN


LABVIEW
TCP allows the developer to setup data communication
between virtual instruments on a network using internet Figure 8. The VI reads from the port that is being written to
protocol addresses and port numbers. TCP sets up an end to
end connection between the two communicating parties over
X. CONCLUSIONS
which the data is sent. For each message sent, the receiver has
to know the length of the package sent in order to use the The idea of open hardware and software solutions for
correct number of bytes in determining the message that was LABVIEW offers an unlimited number of applications in the
sent. With the ability to send and receive messages of varying field of control education. If focusing of the real-time aspect,
lengths, one can develop various complicated methods for the the text-based languages are required to demonstrate a full
transfer of data with the use of state machines. TCP can be control over the executed code. Analyzing several solutions it
used with any protocol that is built with TCP as its base like seems that the LABVIEW is the best candidate to support
http, ftp etc. it enables the developer to set up communications real-time control experiments.
between clients where the clients can “negotiate” on the data
to be transferred and how it will be transferred. REFERENCES
[1] Bassam A Hussein, kjetil Nyseth, “A method for learning in
A. The Advantage: Variable length messages allow clients project management” 9th International Workshop on Experimental
to negotiate the transfer of information, data that is Interactive Learning in Industrial Management.
transferred is buffered by receiver, and Servers can be [2] Gawthrop P.J, McGookin E, “A LEGOR-Based Control
built where desired. Experiment”, IEEE Control Systems Magazine, v.24, October
2004,pp.43-56
B. The Disadvantage: Can be complicated to setup. This [3] Wang E.L, LaCombe J, and Rogers C, “Using LEGOR Bricks to
Conduct Engineering Experiments,” Proceedings of the ASEE
method of data transfer can be used for most kinds of Annual conference and exhibition, session 2756, 2004
data. With a little extra knowledge one can be able to set [4] Ch. Salzmann, D. Gillet, R Longchamp and D. Bonvin, Framework
up interesting communication models between for fast real-time applications in automatic control education, 4th
applications. IFAC Symp, Advances in Control Education, Istanbul Turkey
(1997) pp. 345±350
C. Implementaion: A typical sender-receiver [5] H.A Latchman, Ch. Salzmann, S. Thottapilly and H. Bouzekri,
Hybrid asynchronous and synchronous learning networks in
implementation is shown in the Figure7 and Figure8. distance education, Int. Conf. Enginnering Education, ICEE98,
paper 351, Rio de Janero, Brazil, 1998.
[6] D. Gillet, Ch, Slazmann, R longchamp and D Bonvin,
Telepresence: an opportunity to develop practical experimentation
in automatic control education, European Control Conference,
ECC 97, paper 439, Brussels, Belgium (1997)
[7] Ch. SalZmann, H. A Latchman D. Gillet and O. D. Crisalle,
Requirements for real-time experimentation over the Internet, Int.
Conf. Engineering Education, ICEE98, paper 222, Rio de Janero,
Brazill(1998)

Figure 7. Remote address output value of the TCP

666

Anda mungkin juga menyukai