Académique Documents
Professionnel Documents
Culture Documents
I. INTRODUCTION
At the School of Electrical Engineering and Computer Science of Hanyang University, Ansan, Korea, a real-time control
laboratory course that incorporates real-time programming in
the control laboratory has been offered for senior undergraduate students since 2002 [4]. The course has been very successful, and most of the students have been satisfied with what
they have learned, even though it has been recognized as one
of the more difficult courses. In the class, students write control software using a programming environment based on the
real-time operating system VxWorks from WindRiver Systems
[5], [6]. Since interrupt processing is the only real-time feature
used by the students, they do not have an opportunity to learn
how to use other real-time concepts to write control software.
Some students have expressed interest in learning the features
of the real-time operating system itself.
Motivated by the successful introduction of real-time programming capabilities in the control laboratory, a second realtime control laboratory course was designed and offered. This
paper describes the second real-time control laboratory course,
which is an advanced version of the first course. The course described in this paper is intended for seniors and graduate students. Even though this laboratory course is based on the same
setups as the first one, the overlapping content is minimized so
that students who have already taken the first course can learn
new concepts in this course. Also, this course is designed to
be self-contained, so that students who have not taken the first
course can still follow the course material without difficulty.
However, taking this course after taking the first one is best.
The objective of this course is to teach the following items:
1) the real-time concepts that are employed in most modern
real-time operating systems;
2) ways to implement advanced modern control algorithms
using real-time concepts.
Students who take this course should have adequate knowledge of control system design using both frequency domain and
state space methods at the undergraduate level, and C language
programming. Knowledge of advanced control theories, such as
optimal control and robust control, may be helpful but is not
absolutely necessary. Also, prior knowledge of the operating
system is helpful but not required. Teaching real-time concepts
in the laboratory using real-time operating systems has been
attempted at other institutions; however, those courses concentrated on real-time concepts, such as task scheduling and semaphores [7][10]. The course described in this paper works primarily with the software for controlling dynamic systems.
A. Course Overview
1Available: http://www.mathworks.com/access/helpdesk/help/toolbox/rtw/
rtw.shtml
LIM: A LABORATORY COURSE IN REAL-TIME SOFTWARE FOR THE CONTROL OF DYNAMIC SYSTEMS
347
348
simulator, an Advantech PCL-818L analogdigital (A/D) converter board that employs a BurrBrown ADS574 12-b successive approximation A/D converter is used. To output control
signals to the dynamic simulator, an Advantech PCL-728 digitalanalog (D/A) converter board that employs an Analog Devices AD7541A 12-b D/A converter is used. The voltage range
for both the A/D and D/A converters is from 10 to 10 V.
III. REAL-TIME CONCEPTS FOR CONTROL
In the second part of the course (after the midterm examination), students are required to write real-time control programs using the concepts they have learned in the first part of
the course. The main real-time concepts to be used are multitasking, semaphores, message queues, and interrupts. From the
lectures and the laboratory assignments in the first part of the
course, students have learned and tested these concepts separately, as described briefly in the following listing.
Multitasking with preemptive scheduling: To demonstrate
the use of preemptive priority based task scheduling facilities. A sample program spawns several simple tasks with
different priorities. Students are required to modify the program to change the priorities of tasks and observe how the
output changes.
Semaphores: To demonstrate the use of semaphores for
synchronization. A sample program creates a semaphore
and spawns two simple tasks. Students are required to
modify the sample program so that two tasks are synchronized by semaphore control.
Message queues: To demonstrate the use of message
queues for communication between tasks. A sample program creates a message queue and spawns two simple
tasks that print out received messages. Students are required to modify the sample program so that two tasks
send messages to each other.
Interrupts: To demonstrate the processing of hardware
interrupts. A sample program shows how the interrupts
vector is set up, and the interrupt service routine is invoked.
To write complete real-time control programs, students must
combine the above real-time concepts, which they have learned
and tested in the previous laboratory assignments.
The program written by students should perform two functions: 1) real-time control of a dynamic system and 2) real-time
monitoring of the system output. For these purposes, two tasks
must be created.
1) Task 1: The main function of task 1 is running the control
algorithm. Task 1 must be synchronized with the interrupt
service routine using the binary semaphore. The interrupt
service routine serves only to synchronize the task. All the
functions to control the system, including A/D and D/A
conversion, should be done in task 1.
2) Task 2: The main function of task 2 is sending the captured
system output data to the graphing server running on a host
computer.
Fig. 2 shows the configuration of the real-time control software.
Communication between task 1 and task 2 is via a message
queue. Task 1 sends the captured system output data to task 2
through a message queue; task 2 receives the data and sends it
to the graphing server on the host computer using a TCP data
LIM: A LABORATORY COURSE IN REAL-TIME SOFTWARE FOR THE CONTROL OF DYNAMIC SYSTEMS
349
350
0.1 (sec
Fig. 5. Typical response of the digital implementation of a second-order
system.
(2)
(3)
lectures. In the laboratory sessions, the students have the opportunity to observe the effects that changing the sampling frequency and the digitization methods have on the responses of
the control system.
For this system, students are required to design a lead compensator and a lag compensator that give a phase margin of 55 .
Students implement the digital compensators, using the Euler
method, and observe the step responses.
D. LQG Control
(1)
in their programs and observe the system step response.
In this assignment, the A/D converter reads the output from
a function generator that generates a square wave; the output
of the D/A converter is the output of the implemented secondorder dynamic system. After implementing the above secondorder system, students are able to confirm that they have done
so correctly by observing the step response on oscilloscopes and
the graphing server on the host computer for various values of
and . Fig. 5 shows a typical response.
C. Lead/Lag Compensator
For this assignment and the following assignments, an analog
dynamic simulator, shown in Fig. 6, is used.
(4)
Students are instructed to implement the LQG controller for the
above system using the Euler method. When the LQG controller
is implemented successfully, the output response of the closedloop system to a step reference input signal has responses typical
of those shown in Fig. 8.
LIM: A LABORATORY COURSE IN REAL-TIME SOFTWARE FOR THE CONTROL OF DYNAMIC SYSTEMS
351
For the responses in Fig. 8, the weighting matrices for the cost
function
(5)
are
(6)
The same weighting matrices are used for the design of an optimal state estimator. By changing the position of the switches
to the ON position, students are able to see the changes in the
response when the system parameter is varied. Fig. 8 shows the
step responses of the system for various parameter values. As
seen in the figure, the response of the closed-loop system using
a LQG controller changes significantly when the system parameters vary.
E.
Control
(7)
For simplicity, weighting terms for possible disturbance inputs
are not considered. For the closed-loop system with the decontroller, the maximum gain between the input
signed
is found to be 1.137. By
and the output of the uncertainty
352
controller design: (a) changed block diagram and (b) standard form of a general feedback system with uncertainty.
controller
Comparison of these two figures shows that the
produces significantly improved responses as the system undergoes parameter fluctuations.
V. ASSESSMENT OF STUDENT PERFORMANCE AND
STUDENT REACTIONS
This course was offered in the 2004 and 2005 fall semesters.
Evaluation of student performance was based on two examinations and laboratory reports. The first examination was taken
after completing the first part of the course and consisted of
questions about real-time concepts. At the end of the semester,
the final test examined students knowledge on the implementation of digital controllers. The laboratory reports were submitted
after each laboratory session. Officially, each laboratory assignment was three hours, but many students needed an additional
hour in the laboratory to finish their assignments.
At the end of the semester, students were asked to fill out standardized evaluation forms, which contained 15 standard multiple-choice questions and a space for written comments. Table I
shows the evaluation data for the questions related to the course
content.
In the table, the number in each cell is the number of students who selected that particular choice, and the averages were
LIM: A LABORATORY COURSE IN REAL-TIME SOFTWARE FOR THE CONTROL OF DYNAMIC SYSTEMS
353
controller.
TABLE I
STUDENT EVALUATION RESULTS (KEY: SASTRONGLY AGREE, AAGREE, NNEUTRAL, DDISAGREE,
SDSTRONGLY DISAGREE, AVGAVERAGE): (a) 2004 AND (b) 2005
354
dents and the rest of the class, showing that the overlapping of
the course material with the first course was minimized, as intended. For future classes, the control theory lecture portions
need to be reinforced to help the students who do not have adequate knowledge in the area of dynamic systems control.
VI. CONCLUSION
This paper describes a laboratory course in real-time software
for dynamic systems control. In the first part of the course, realtime concepts employed by modern real-time operating systems
are taught with laboratory assignments. In the second part, students are required to write real-time software for control using
the real-time concepts that they learned in the first part. The controllers that they are required to implement range from a simple
control. Real-time prolead/lag compensator to complex
gramming is usually avoided in teaching a feedback control laboratory course, since it has generally been considered difficult.
However, the student evaluation results for this course show that
real-time programming can be successfully included in a feedback control laboratory course. From this course, students are
able to obtain a working knowledge of both real-time concepts
and real-time programming for dynamic systems control.
REFERENCES
[1] P. S. Shiakolas, Development of a real-time digital control system
with a hardware-in-the-loop magnetic levitation device for reinforcement of controls education, IEEE Trans. Educ., vol. 46, no. 1, pp.
7987, Feb. 2003.
[2] A. B. Koku and O. Kaynak, An Internet-assisted experimental environment suitable for the reinforcement of undergraduate teaching of
advanced control techniques, IEEE Trans. Educ., vol. 44, no. 2, pp.
2428, Feb. 2001.
[3] A. Leva, A hands-on experimental laboratory for undergraduate
courses in automatic control, IEEE Trans. Educ., vol. 46, no. 2, pp.
263272, May 2003.
Dong-Jin Lim (S79M84) received the B.S. and M.S. degrees in electrical
engineering from Seoul National University, Korea, in 1979 and 1981, respectively, and the Ph.D. degree in electrical and computer engineering from the
University of Iowa, Iowa City, in 1988.
From 1988 to 1991, he was a Research Engineer at the Research Institute of
Science and Technology, Korea. Since 1991, he has been with the School of
Electrical Engineering and Computer Science of Hanyang University, Ansan,
Korea. His current research interests include real-time control and robust control
of dynamic systems.