Theory, simulation, experimentation - IEEE Xplore

2 downloads 109 Views 531KB Size Report
Harold Klee and Joe Dumas. Abstract-This paper discusses the approach adopted by the authors for teaching an undergraduate course (lecture and lab-.
IEEE TRANSACTIONS ON EDUCATION, VOL. 37, NO. 1, FEBRUARY 1994

51

Theory, Simulation, Experimentation: An Integrated Approach to Teaching Digital Control Systems Harold Klee and Joe Dumas

Abstract-This paper discusses the approach adopted by the authors for teaching an undergraduate course (lecture and laboratory) in digital controls. Theoretical material is developed in the lecture concerning the application of direct digital control (DDC) to an analog bench-scale system consisting of a dc motor and tachometer. A simulation of the closed-loop control system with embedded digital controller is developed and run by the students using the TUTSIM dynamic simulation language. Finally, students perform a laboratory experiment in which they write a program to control the actual system using a personal computer and inexpensive interface card. The combination of hands-on experience and computer simulation with the more traditional, theoretical lecture material provides a well-rounded learning experience that better prepares the students to implement digital control systems in the real world.

I. INTRODUCTION

E

NGINEEKING students interested in the field of systems and control are generally exposed to introductory courses involving the analysis and design of analog and digital linear control systems. Bench-scale analog systems have been available for many years to reinforce the principles of linear control theory in the lab. In the last decade, the analog control function has been replaced by a digital controller in many of the newer instructional systems used for demonstrating the underlying theory of digital controls. At the University of Central Florida, the undergraduate program in computer engineering includes a considerable amount of systems engineering, i.e., dynamic systems modeling, controls, and simulation. A first course combining linear control theory and continuous system simulation provides the necessary background for the follow-up course in digital controls. The second course has a laboratory section in which some of the analog systems used in the introductory course lab have been modified for use with digital controllers. Consequently, supporting laboratory documentation and assignments have been generated internally. One of the systems in the laboratory is a liquid tank with a pneumatic controller. A description of the system and the modifications required for interfacing to a digital computer is discussed in [I]. The emphasis in that study was on the use of simulation to design the digital compensator. Experimental Manuscript received July 1991; revised October 1991. H. Klee is with the Department of Computer Engineering, University of Central Florida, Orlando, FL 32816. J. Dumas was with the Department of Computer Engineering, University of Central Florida, Orlando, FL 32816. He is now with the Department of Computer Science and Electrical Engineering, University of Tennessee at Chattanooga, Chattanooga, TN 37043. IEEE Log Number 9214218.

n-lbs

MOTOR

I W(t)

m CONTROL ALGORITHM

vons

DIA

TACH

Fig. 1. Closed-loop digital control system.

verification of the resulting design was not addressed in that paper; however, it is included in the corresponding digital controls laboratory assignment. Another bench-scale system, initially designed for demonstrating analog control principles, is an armature-controlleddc motor equipped with a magnetic speed brake for introducing continuous disturbance inputs [2]. The system was easily adapted for use in the digital controls lab. Several classroom lectures are devoted to direct digital control (DDC) of the motor. A sequence of experiments was designed beginning with system calibration and progressing through open-loop control to closed-loop servo control. From the beginning, the primary objective of this sequence of experiments was to allow the students the opportunity of verifying, with actual hardware, the results based on theoretical design principles. Later on, an additional component for system analysis was added, namely, digital computer simulation. A lab assignment was developed involving the use of a continuous simulation language well suited for simulating systems with continuous and discrete elements. The simulation language TUTSIM [3] is introduced in the first controls course, where the emphasis is on strictly continuous systems. The second course includes a discussion of the language features necessary for analyzing the behavior of sampled-data systems with embedded digital controllers. The simulation component is an integral part of the learning experience because it provides the students with a tool for verification of system design objectives. Indeed, in the real world, the design of complex engineering systems begins with a theoretical design, later modified or fine-tuned as a result of simulation studies prior to actual system implementation. The combination of theory, simulation, and laboratory experimentation has much to offer when compared to more

0018-9359/94$04.00 0 1994 IEEE

IEEE TRANSACTIONS ON EDUCATION, VOL. 37, NO. I , FEBRUARY 1994

58

Fig. 2.

Equivalent system block diagram (zero load torque).

traditional text-based instruction only. It is safe to say that students completing the undergraduate digital controls course are better prepared to implement simple DDC because of the simulation work and hands-on experience acquired from the lab assignments.

(rads)

0.25

11. SYSTEM DESCRIPTION The continuous portion of the system under consideration consists of an armature-controlled dc motor with a tachometer generator integrally mounted on its shaft. The analog controller input/output connections on the motor control panel are bypassed, and the appropriate signals are directed to and from a data-acquisition board resident inside the digital computer. Twelve-bit A/D and D/A converters provide the interfaces between the digita1 computer and the continuous components of the system. system corresponding to the The closed-loop in system hardware is represented in diagram Fig. 1 . The variables shown are deviations about a nominal steady-state operating point. 111. THEORY

The transfer functions

KM G ( s )= 7s 1

+

and

KL G L ( s )= rs

TABLE I.

SYSTEMDESIGNREQUIREMENTS

resulting in the following characteristic equation:

~ ( z=)z2 + ( c l a - e-T/T

+ c l p + e-T/T

- 1)”

(5)

where c1

= K T K M ( ~ - epTlT).

(6)

Classroom discussion focuses on the closed-loop transfer function pole locations in the z-plane to achieve specific design objectives related to the transient response of the discrete system. In fact, one p m of the closed-loop control lab experiment calls for system designs to satisfy the damping ratio and natural frequency ( w n ) requirements shown in Table I, with the students determining values for the missing elements. P and T, are the overshoot and 2% settling time, respectively, in the digital closed-loop system step response. R and 0 represent the polar coordinates of the control system transfer function z-plane poles, and Q and p are the required control parameter values to satisfy the design requirements. A theoretical solution is developed in class. The results are summarized below.

+1

are developed in class. Numerical values for the motor gain ( K b f )and time constant ( r )as well as the tach gain ( K T )are empirically determined in the initial experiment. Load torque ( T L )is assumed to be zero in this analysis. For design purposes, the control system block diagram, with zero load torque applied, is drawn as shown in Fig. 2. The pulse transfer function G ( z )representing the D/A, motor, and A/D is given by

(3)

Finally, the analytical solution of the closed-loop system step response is derived and shown below.

with T the sampling period. Using a discrete P-I controller, as developed in most digital controls texts, [4,] [5],gives

D(z)=

az+p ~

z-1

(4)

e - T / T s i n ( k O ) - Rsim[(k + I)@]}] k = O , 1 , 2 , 3,...

KLEE er al.: THEORY, SIMULATION, EXPERIMENTATION: 1NTEGRATED APPROACH TO TEACHING DIGITAL CONTROL SYSTEMS

Y2: D u c t )

110.8888

- s ;IWULIITED

59

Sinulated IL Rnalytical Responses

I

I

I

I

1

98 .BBBB

86.8888 74 .ma0

62.me0 50.8888

38.BB88 26.8888 14 .8888 2 .e000 8.0000

18.8888

Time

Fig. 3. TUTSIM simulated and analytical stepI responses for digital control of motor speed.

TABLE 11.

D(Z )

IV. SIMULATION The digital control system theoretical designs are verified by computer simulation. Students are required to develop digital simulations of the system using TUTSIM to investigate the dynamic response characteristics in relation to the design objectives. The TUTSIM language provides the tools for obtaining numerical solutions to the coupled differential, algebraic, and difference equations that govern the behavior of the system. Some of the capabilities of TUTSIM are illustrated by example in [ll, [6]-[81. Certain features of TUTSIM, such as interactively varying system parameters and viewing desired input and output signals for selected periods of time, simplify the process of verifying whether system design objectives have been satisfied. In addition, an analytical solution can be evaluated as part of a TUTSIM simulation for purposes of comparison with a simulated response. For example, Fig. 3 is a TUTSIM graph showing the reference input and the (continuous) simulated and (discrete) analytical motor responses for 10 s. Control parameters a and p were calculated from (11) = 0 . 7 , ~ = ~1 and (12) corresponding to design values rad/s, and a sampling time T = 0.25 s. The physical system parameters K M and T in the motor transfer function, (l), and the tachometer gain KT were determined experimentally to be MOTOR: K M = 355 RPM/volt r = 0.57 second

TACH: KT = 0.00204 volt/RPM. It is clear from Fig. 3 that the simulated and analytical responses of motor speed are in excellent agreement. The simulated response is obtained by numerical integration of the first-order differential equation describing the motor dynamics, d r-w(t) w ( t ) = KhftJi(t) dt Fourth order Adams-Bashforth integration with a step size of 0.00025 s was used. TUTSIM provides the user a choice of either Adams-Bashforth or simple Euler numerical integration.

+

DIFFERENT SAMPLING RATESPRODUCING SIMILAR STEPRESFONSES PARAMETER VALUES FOR TWO

T

a

d

0.25 1.00

-0.0283

0.2324 0.1229

0.7055

From (7) and (S), the overshoot and 2% settling time corresponding to the design damping ratio (C = 0.7) and natural frequency (wn = 1 rad/s> are P = 0.046 and T, z 5.7 s, respectively. Fig. 4 shows an enlargement of the motor step response in the region from 95 to 105 RPM following a 100 RPM increase in the reference input to the control system. A band from 98 RPM to 102 RPM is included for approximating T,. The overshoot and 2% settling time measured from the graph are 0.047 and 6.2 seconds respectively, which compare reasonably well with the computed values. TUTSIM can be used effectively to investigate the sensitivity of system performance to variations in control system parameters. For example, one might investigate the feasibility of achieving a similar overshoot ( P z 0.05) and 2% settling time (Ts z 6 s) with different sampling rates. Fig. 5 shows the motor step response (-90 RPM to 110 RPM scale not shown) and voltage input corresponding to sampling periods of 0.25 s and 1 s. The results of this investigation suggest that effective control of the motor is possible at considerably slower sampling rates than those assigned for the laboratory experiment. The digital compensator coefficients a and p along with the sampling times are listed in Table I1 below. The simulation capability allows the student to visualize the response of a system designed to meet specific performance requirements. In the absence of physical hardware, lingering questions remain pertaining to the behavior of the actual system. The reasonableness of the assumptions made in modeling the system dynamics, e.g. , ignoring armature inductance, viscous damping, and shaft compliance, becomes apparent when (and if) experimental data are consistent with theoretical analyses and simulation results. Thus, the third component in teaching principles of digital controls involves

~

IEEE TRANSACTIONS ON EDUCATION, VOL. 37, NO. I , FEBRUARY 1994

60

I

105.8888

1

1

I

I

I

1

164.8888

1w .wee

.I

m . 8 8 8 8

1ei.e"

-

188.8888 99.8888 98.8888

96.8888 95.8888

I

I

I b

I

I

I

I

8.8888

I

I

Time

I

le. eeee

I

Fig. 4. Portion of simulated step response showing overshoot and settling time.

Hotor Speed/Uo ltage Input(1-. E ,1 I

,

I

T = 1.00 s T

= 0.25

s

t 8.8888

Fig. 5.

Tine

ie .e"

Simulated motor speed and voltage input for different sampling periods (Overshoot z 5%#).

through a D/A converter on the analog/digital interface card. The students' software must also be able to read a discrete value representing tachometer voltage VT from an A/D port on the interface card and convert it to the corresponding indicated V . EXPERIMENTATION motor speed for display on the CRT. Before performing the closed-loop digital control experiAfter completing the two preliminary lab experiments and ment, the students are given two preliminary lab assignments covering the applicable theoretical material (outlined above) to familiarize them with the hardware and software elements in the lecture section of the course, the students are ready needed for speed control of the dc motor. During the first laboratory period, students use the built-in features of the to proceed with implementation of DDC in the laboratory. analog bench-scale system to derive calibration curves for For this experiment, they are required to write a program that the steady-state characteristics of the motor and tachometer. allows the user to input values for the sampling interval T and Thus, each student determines empirical values of K11.i and the control parameters a and p. The reference motor speed KT for use in all subsequent lab and simulation work. The is also accepted, and the corresponding voltage is sent to the next assignment requires the students to use the relationships motor for initialization purposes. The program must then enter obtained in the first experiment to perform open-loop control a loop to scan the keyboard for commanded speed changes. The repetitive portion of the program, consisting of A/D of the motor speed. input, processing (units conversion, controller difference equaUsing a PC/AT computer with the same hardware setup and low-level software routines (supplied by the instructor) re- tion, limiting), and D/A output runs as an interrupt service quired for the subsequent closed-loop experiment, the students routine. This routine is executed every T s by modifying write a C program to calculate the voltage needed by the motor a counter value inside the PC/AT host and appending the to achieve a given steady-state speed in RPM (in the absence students' code to the DOS timer routine. At each iteration of disturbances) and output a discretized version of this signal of the control algorithm, the values of important quantities laboratory experimentation as a means of addressing these and other issues related to real-world system performance.

KLEE et al.: THEORY, SIMULATION, EXPERIMENTATION: INTEGRATEDAPPROACH TO TEACHING DIGITAL CONTROL SYSTEMS

61

J; Damping ratio = 0.7 I Naturalfrequency = 1.O rad/s Sampling period = 0.25s 1

1540

ampling period = 0.05s

~

-

1460

2

5

4

3

6

7

1

6

0

10

11

l

12 1460

Time (seconds)

1-

Speed mmmand

A

Expenmental resp

- TUTSIM simula1ion

Time (seconds)

I

-Sp& Fig. 6. Digital control system step response.

Fig. 8.

--

--I

A

mmmand

Experimentalrasp

~~

1 TUTSlMsimula1ion

Digital conirol system step response.

I

ki

5

p

s

Damping ratio = 0.3 Natural frequency = 1.O rad/s Sampling period = 0.05s

I

6.15-

I 61-

m 6.05-

Naturalfrequency = 1.O rad/s Sampling period = 0.25s

m

1 -

I

,

For clamiy expenmental and NTSlM mmputed values shown evwy 0 25 s

0

,

I

/

#

8

,

I

8

8

8

1

Time (seconds) 3

4

A

5

6 7 Time (remnds)

Experimental

6

0

10

11

2

A

ExpBnmenmi

0 T U W M simulation

0 TUTSiM simulation

Fig. 9.

Digital controller output.

Fig. 7. Digital controller output.

and the analytical solution of the closed-loop system step (sample number, V,,VT,w,and so on) are saved to temporary response with T = 0.25 s, C = 0.7, and w, = 1.0 rad/s storage arrays. Upon program termination, the stored data is were nearly identical and in close agreement with the design written to an ASCII text file on disk. The students can then values for overshoot and settling time. Figs. 8 and 9 show use a spreadsheet program to graph the experimental data the excellent match obtained between the simulation and and observe the nature of the system response to step input the experimental data taken in the lab. Thus, if the control commands. algorithm parameters are computed properly (for given design Figs. 6 and 7 are plots of experimental data obtained in the specifications), and the students perform the various parts digital controls laboratory along with the corresponding data of the experiment correctly, the three approaches to underobtained from a TUTSIM simulation of the experiment. (Note standing the digital control system-theory, simulation, and that in these and subsequent graphs absolute data values, rather experimentation4onverge to a single answer and reinforce than deviations from steady-state conditions, are shown.) For each other. If, as often happens, the students have problems this run, the values T = 0.05 s, C = 0.3, and wn = 1.0 rad/s performing the lab experiment, the theoretical material and (see Table I) were used. Fig. 6 compares the motor speed from simulation runs provide checks to help them diagnose and the TUTSIM run with the measured motor speed (calculated correct their errors. from the sampled values of tachometer voltage VT).Fig. 7 shows the experimental and simulated values for the digital VI. CONCLUSION controller output (the voltage sent through the D/A converter to The availability of inexpensive yet powerful microcomputer the motor). Both plots reveal an excellent agreement between simulated and real-world motor operation, even though the VT components has led to a greatly increased use of digital control signal was somewhat noisy. (No filtering was applied to the in industry. Consequently, it has become more important that students gain a working knowledge of this topic as part values read in from the A/D converter.) Another experimental run using the second set of pa- of their engineering education. The most effective way of rameters in Table I illustrates the convergence of theory, accomplishing this is by supplementing the theoretical material experimentation, and simulation. It was shown previously with practical experience. In recent years, sophisticated yet that a TUTSIM simulation of the motor-speed control system inexpensive simulation software has become available for use

62

by undergraduate students. Simulation augments the practical experience gained in the laboratory by allowing the student to try many more approaches (and experimental runs per approach) in a shorter time than would be possible using real hardware, especially where laboratory space and/or time are limited. At the University of Central Florida, undergraduate students in computer engineering are required to take a lecture and laboratory course in digital controls. Over several offerings, this course has evolved from a theoretical treatment with a small amount of lab work into an intensive study of the application of DDC principles using both simulation studies and laboratory experiments against a well-developed backdrop of theoretical material. The simulations and lab experiments, besides helping to reinforce the theoretical material, are fun for the students to perform and help to break the monotony often experienced in heavily theoretical courses. Of particular importance at UCF (and no doubt at many other universities as well) is the fact that the digital controls course can be offered without an excessive requirement for financial support. The processes used in the lab have rather long time constants, so a relatively slow, inexpensive 80286 or even 8088-based personal computer can be used as the controller. Use of PCs rather than single-board or singlechip microcontrollers offers the advantages of convenient disk storage of data and programs. Inexpensive software products, such as Borland’s Turbo C and Quattro, further augment the capabilities of the IBM-PC as a digital controls laboratory workstation. IBM-compatible interface cards with multiple A/D and D/A channels are available for a few hundred dollars. Finally, modification of existing bench-scale analog control trainers and generation of the laboratory assignments and other supporting documentation by department personnel also helped to hold down the cost of offering the laboratory section. We believe that the systems chosen for theoretical development, simulation, and laboratory experimentation in the digital controls course at UCF are excellent for teaching students about a subject many of them will encounter in their subsequent work. The system described here, like the liquid level control system mentioned in [ 11, controls a process that the students can see, touch, and “get a feel for.” This hands-on experience, coupled with theoretical development and computer simulation, provides a well-rounded learning experience resulting in better-prepared students.

IEEE TRANSACTIONS ON EDUCATION, VOL. 37, NO. 1, FEBRUARY 1994

REFERENCES [ l ] H. Klee, “Simulation and design of a digital control system with TUTSIM,” IEEE Trans. Educ., vol. 34, pp. 76-82, Feb. 1991. [2] Course PCT-1: DC-motor Speed Control, DEGEM Systems, Pompano Beach, FL, 1982. [3] TUTSIM, The Engineering Design Aid-User’s Manual, Tutsim Products, Palo Alto, CA, 1987. [4] R. Jacquot, Modern Digiral Control Systems. New York: Marcel Decker, 1981. [5] B. C. Kuo, Digiral Control Sysrems. New York: Holt, Rinehart and Winston, 1980. [6] H. Klee, “Interactive simulation of continuous dynamic systems using TUTSIM,” in Proc. Int. Conf. of Comput. in Ind. Eng., pp. 355-357, 1984. [7] H. Klee, “Comparison of a block oriented and equation oriented continuous simulation language,” in Proc. Eastern Simulation Conf., pp. 105-109, 1986. [8] M. Ward, “Dynamic systems simulation using TUTSIM,” J. Compur. in Educ.vo1. I X , no. 3, pp. 53-56, 1989.

Harold Klee received a B.S.M.E from Cooper Union in 1965, an M.S. and Ph.D. in systems engineering from the Case Institute of Technology and the Polytechnic Institute of Brooklyn in 1968 and 1972, respectively. He is presently employed as Associate Professor in the Department of Electrical and Computer Engineering at the University of Central Florida. He has been at UCF since 1972. His main area of teaching and research is continuous system simulation. Dr. Klee is the project director of an ongoing UCF program investigating the potential applications for a low-cost interactive driving simulator. He is also actively involved in precollege mathematics and science instruction. Since 1990, he has been teaching several UCF engineering course at a local high school.

Joe Dumas received the B.S. degree from the University of Southem Mississippi, Hattiesburg, MS, in 1984; the M.S. degree from Mississippi State University, Starkeville, MS, in 1989; and the Ph.D. degree from the University of Central Florida, Orlando, FL, in 1993. He is presently employed as an Assistant Professor in the Department of Computer Science and Electrical Engineering at the University of Tennessee at Chattanooga, TN. From 1984-1985, he was employed as an electronics engineer by Seismic Engineering Company of Dallas, TX. He served as a Visiting Instructor of computer engineering technology at the University of Southern Mississippi in 1985-1986 and as a graduate teaching assistant at Mississippi State from 19861987. From 1988-1989 he worked as a research assistant on the MADEM multicomputer project at MSU. While at the University of Central Florida, he was employed as a teaching and research assistant in the Department of Electrical and Computer Engineering (1989-1992) and as a graduate/postdoctorate research assistant at the Institute for Simulation and Training (1993). Dr. Dumas received the 1991-1992 Link Foundation Fellowship in Advanced Simulation and Training in support of his doctoral research in the area of transport delay compensation for real-time, man-in-the-loop vehicle simulators.