Session 3663

Teaching Analog And Digital In One Course

Hakan B. Gurocak

Manufacturing Engineering Washington State University 14204 NE Salmon Creek Ave. Vancouver, WA 98686

Abstract: Today's trend is towards a high level of manufacturing automation and design of smart products. All of these products or their manufacturing processes contain control systems. As indicated in a recent survey, both analog and digital control modes are used by the industry to implement controllers. In a typical undergraduate engineering curriculum a control systems course introducing the fundamental notions of analog control theory is offered. To learn digital control theory, students would have to take an extra course on digital control systems, usually at the graduate level. This paper explains the development of a hybrid classical/digital control systems course*. Also, laboratory experiments designed to support the new format are presented.

Introduction Manufacturing engineering is a very broad discipline. Consequently, manufacturing engineers typically engage in a diverse range of activities such as plant engineering, manufacturing processes, machine design, and product design. In just about any of these roles a manufacturing engineer is challenged by a control system since today's trend is towards a high level of manufacturing automation and design of smart products. For example, such products include active suspensions in cars that can adjust to the road conditions or video cameras that can stabilize images that would otherwise be fuzzy due to the shaking of the hand holding the camera. As the industry continues to introduce more sophisticated control applications in its products and manufacturing processes, the engineers who design, develop and build these products and systems will face a challenging, dramatic change in their role. Therefore, they need to better understand and be able to apply control systems theory.

Page 4.478.1 * Partial support for this work was provided by the National Science Foundation's Division of Undergraduate Education through grant DUE # 9796330. One difficulty in teaching control systems is to provide a balance between theory and practice1. A control systems laboratory that provides the connection between the abstract control theory and the real world applications is an invaluable tool for this purpose. However, given today's trend, this is not the only dilemma the educator is facing. Because of the ability of a digital to process immense quantities of information and base control strategies on that information, more and more control system designs involve a digital controller as part of the control strategy2.

A typical introductory control systems course found in the undergraduate curriculum of many universities introduces the theory of analog controllers. These are controllers that are implemented by analog signal processing circuitry. Usually these introductory courses are followed by other control systems courses such as digital control systems where the theory of the digital controllers is introduced. These controllers are implemented by using a computer as opposed to analog signal processing circuitry. Because industrial applications involve both digital and analog control modes, a good control systems education should contain the relevant theory of both fields. However, in many cases due to the limitations on the maximum credit requirements it is not possible to offer a digital control systems course at the undergraduate level. As a result the students either have to take such a course at the graduate level or, as is usually the case, they graduate without the digital control systems knowledge.

The Manufacturing Engineering degree program at Washington State University in Vancouver requires 128 credits for graduation. When the curriculum was designed a single control systems course was planned. There is no graduate program at the Vancouver campus and also there is no digital control elective in the curriculum.

This paper presents a hybrid analog/digital undergraduate control systems course with laboratory experiments. The course enables the students to learn the most fundamental theory of both analog and digital control systems, as well as their actual physical implementation in a single course. Consequently, the total credit requirement for the degree is not increased yet the students graduate with a working knowledge of both analog and digital control systems.

Course Content ME 375 Manufacturing Control Systems course is a three semester-credit course with two hours of lectures and three hours of laboratory per week. The course was offered for the first time in Spring 1998 in the Manufacturing Engineering program at Washington State University in Vancouver. The course content (Table 1) has been carefully organized to reflect the basic concepts, namely, dynamic system specifications, stability, concept of and dynamic compensation, that a control engineer must understand. A recent survey1 indicates that classical control techniques, as opposed to state space techniques, still dominate the industry. Therefore, the course content places more emphasis on classical control theory than the state space approach. Since the theory of digital control systems very much parallels that of analog control systems, many of the concepts are covered in parallel for both digital and analog control

systems. The integrated, parallel approach taken in the course highlights the differences and Page 4.478.2 similarities in both control modes as new theory is introduced throughout the semester. Table 1. Course content of ME 375. 1) DYNAMIC RESPONSE 4) ROOT-LOCUS DESIGN METHOD 1.1 Continuous-time systems (analog) For both continuous and discrete-time systems 1.1.a Transfer functions, block diagrams 4.1 Root-locus properties 1.1.b Poles and zeros 4.2 Rules for sketching the root locus 1.1.c First order response 1.1.d Second order response 1.1.e Transient response requirements 1.2 Discrete-time systems (digital) 1.2.a Difference equations and z-transform 1.2.b Pulse trans. func. and sampling theorem 1.2.c Solution techniques for difference eq. 2) FREQUENCY RESPONSE 5) COMPENSATOR DESIGN VIA 2.1 Bode plots for continuous systems. ROOT LOCUS METHOD For both continuous and discrete-time systems 5.1 PI, PD and PID design 5.2 Ziegler-Nichols PID tuning technique

3) PRINCIPLES OF FEEDBACK 6) STATE SPACE DESIGN For both continuous and discrete-time systems For continuous-time systems 3.1 Open, closed loop systems 6.1 Brief discussion of state space representation 3.2 Types of feedback (P, PI, PD, PID) 3.3 Steady state accuracy and system type 3.4 Stability 3.5 Actuators, feedback devices, PLCs.

Laboratory The controller designs discussed in the lectures are based on MATLAB/SIMULINK simulations. This is certainly useful, but it cannot replace real equipment1,3-8. It is important that the students learn about the real world issues such as measurement noise, friction and actuator saturation that are hard to incorporate into a simulation. In addition, they need to get familiar with some of the technology such as tachometers, encoders, etc., used in the implementation of control systems. The laboratory sessions are designed to fill these gaps. At the beginning of each session a lecture related to the experiments is given. This lecture complements the formal lectures of the course and in many ways gives a chance to relate the theory discussed in the formal lectures to the practical issues and implementations.

Equipment The equipment needed to develop the new laboratory includes servo fundamentals training units by Feedback Inc., function generators, oscilloscopes and software for simulation and design. Table 2 gives a list of the hardware and software that are used in the laboratory. Figure 1 shows the servo fundamentals unit by Feedback Inc. It consists of three parts: (1) mechanical unit, (2) analog unit, and (3) digital unit and its software. The mechanical unit has a DC motor, gear reduction, tachometer, encoders and potentiometer position sensors. The analog unit has analog electronics (with Op Amps) to drive the mechanical unit. The digital unit has interface Page 4.478.3 electronics for interfacing a computer to the mechanical unit. It also comes with a tutorial style software. Using these units students can quickly construct control circuits by plugging wires into the units. Parts of the units such as the error channel on the analog unit can also be used for experimentation.

Table 2. Hardware/software used in the laboratory.

Feedback 33 Series Analog and Data Acquisition Cards (DAQ) Digital Servo Fundamentals Trainers ComputerBoards, Inc. Product 33-001 CIO-DAS1600/16 DAQ card (Includes: Mechanical, analog (Includes driver software) and digital unit as well as a driver software) Function Generators (Hewlett-Packard 33120A) MATLAB functional unit (MATLAB) Oscilloscopes (Control systems toolbox ) (Tektronix TDS 220) (SIMULINK) Triple Output Power Supplies (Hewlett-Packard E3631A) QuickBASIC compiler

Figure 1. Analog unit (with wires), mechanical unit and the digital unit of the servo fundamentals trainer by Feedback, Inc.

Laboratory Sessions ME 375 contains thirteen weekly laboratory sessions. The objectives are to (1) provide a better understanding of the concepts of abstract control systems theory, (2) highlight the differences and similarities between the digital and analog control modes, and (3) teach the

hardware/software implementation of the mathematical controller designs for both control Page 4.478.4 modes. Following is a brief description of each of the sessions. Laboratory 1: This laboratory session starts with a tour of the laboratory to get familiar with the available hardware and software. Also, it includes laboratory safety instructions. As a first-time hands-on experience with the equipment, the students are asked to generate waveforms using a function generator and visualize them using an oscilloscope. They experiment with the settings of both units to generate and capture waves with different frequencies, amplitudes and duty cycles. Laboratory 2: In this laboratory session students conduct two experiments. The first experiment teaches them how to connect external analog signals to a data acquisition (DAQ) board and write a small program using QuickBASIC compiler to collect data. They use an adjustable power supply to generate DC voltage signals. The voltage level is varied from -5 to 5 volts with 1 volt increments. At each level they record the binary number assigned to the voltage by the DAQ board. Finally, the collected data is used to compute a scaling factor to be used in the small program they wrote. The second experiment involves Op Amps. After studying the basic theory of Op Amps they construct an Op Amp circuit using parts of the analog unit. The circuit is used as a summation junction for two analog signals. Laboratory 3: This laboratory introduces concepts such as damping ratio, time constant and natural frequency that are related to the first and second order system response. The laboratory session starts with a theoretical discussion of first and second order systems and their transient response characteristics. This is followed by two experiments. The students are given a wiring diagram to set up a first order and a second order system. At this point they do not know the details of either of the systems. The systems rather are used to obtain various response types. The first order system is the speed response of a DC motor with a tachometer. They measure the time constant of the response. The second order system is a feedback position control system with a proportional gain. The system uses the mechanical and analog units. By adjusting the gain, students obtain different types of responses such as underdamped or overdamped. They observe the motion of the motor shaft and see it on the oscilloscope. They also measure the percent overshoot and peak time of the underdamped case. Laboratory 4: This laboratory session presents the working principles of an analog-to-digital (A/D) converter and a digital-to-analog (D/A) converter. It also introduces pulse-width-modulation (PWM) technique and the problem of motor stiction. Finally, the Nyquist criterion for choosing sampling frequency is introduced. The students conduct four experiments. The first experiment is about PWM. Students construct a circuit and run the mechanical unit under the control of the digital unit and its associated software. The software displays the PWM motor driver signal and measures the corresponding motor speed. They can experiment with different speeds by changing the duty cycle of the drive signal. The second experiment is about D/A and A/D. Using the digital control

hardware, its software and the mechanical unit they can experiment with the Page 4.478.5 A/D and D/A and find out about the quantization errors. The stiction experiment is the third one in this laboratory session. Using the same set up and the software, they can see the advantages of using a PWM motor drive as opposed to a regular motor drive to reduce the motor stiction. The last experiment is a sampling experiment. They generate a sine wave using a function generator and sample it at three different frequencies using the DAQ board. Later, they plot the sampled data to compare the sampled waves to the original one. Laboratory 5: This laboratory session contains three experiments. The first experiment is about the determination of the transfer function of a system using Bode plots. In this experiment the students connect a sinusoidal signal generated by the function generator to the motor of the mechanical unit. The motor speed is measured using the tachometer. The frequency of the input sinusoidal is varied while the amplitude and phase shift of the corresponding response at each frequency is recorded. The data is then used to make a Bode plot from which the transfer function of the system is estimated. In the second experiment the students set up an error channel with negative feedback. They turn the input position potentiometer on the mechanical unit and observe the output shaft position. The final experiment emphasizes the polarity of the feedback signal and its effect on the system stability. They reverse the polarity of the feedback signal and observe the unstable system response. Laboratory 6: In this laboratory session students learn about different types of control signals that can be generated based on the error in the system. These signals, namely, the proportional error, the rate of change of error and the integral of error are explained in detail. Then the students conduct four experiments. The first three experiments involve implementation of a differentiator, an integrator and a PID control mode using the Op Amp circuitry of the analog unit. The fourth experiment shows how the same control signals can be implemented using the digital technology. In the differentiator experiment they use a triangular input signal and observe a square wave at the output. In the integrator experiment they use a constant input signal and observe a ramp at the output. The fourth experiment is run using the digital unit and its software with the mechanical unit. The software is used to show how the same control signals can be generated using the computer. The session is finished by combining the individual signals to obtain a PID signal. Laboratory 7: This laboratory session concentrates on two topics. The first one is how to write software to implement the control signals introduced in the previous laboratory session. In this part of the session, the students write their own programs to sample an error signal using the DAQ board and to generate the differentator and integrator signals from the sampled signal. They learn the software polling technique in sampling an analog signal. A square wave generated by the function generator is used as the error signal. The second topic in this session is the velocity feedback in a closed-loop position control system. In this experiment they set up the position control system using the

analog and the mechanical units. They vary the velocity feedback gain and Page 4.478.6 observe both the system itself and its measured response on the oscilloscope. Laboratory 8: This laboratory session is about absolute and incremental encoders. The session starts with a theoretical coverage of absolute encoders. The binary and gray codes are discussed and compared. This is followed by a discussion of incremental encoders and their comparison to the absolute ones. Finally, velocity measurement with incremental encoders is presented. The students conduct two experiments using the mechanical unit, the digital unit and its software. The software allows them to use each type of encoder on the mechanical unit to observe the pulse train generated. It also shows how the incremental encoder can be used in rotational speed measurements. Laboratory 9: In this session root-locus design technique and how it is used to adjust gain in an analog position control system with a proportional controller is discussed. The students are given a wiring diagram to construct the system using the mechanical and analog units. Then, they are asked to make a block diagram of the system and identify the transfer functions of each of the components. The system consists of an error channel with a pre-amplifier, control gain, a DC motor with a load, tachometer, motor drive amplifier and gear reduction. The block diagram then is used in a MATLAB file that the students write to plot the root locus of the system and to adjust the gain for a desired response. Finally, the design is verified by setting the gain in the hardware to the computed value and by measuring the actual response. Laboratory 10:In this laboratory the same system as in the previous laboratory is used. However, this time a digital controller is designed and implemented by writing software. The controller is designed using the emulation method where the root-locus study is done in the continuous time domain and the gain for the desired response is computed. Then, the design is converted into the digital domain and the system response is tested. The design process is implemented using MATLAB. Students use the MATLAB file from the previous laboratory as a starting point. Then they expand the file to convert their design into a digital controller and simulate the response. They obtain the gain necessary to meet the desired response requirements. Finally, they write a program using the QuickBASIC compiler to implement the designed controller. Their software controls the mechanical unit. The system response is captured with the oscilloscope and compared to the desired response specifications. Laboratory 11:This laboratory session teaches how to design an analog position control system with a PD controller. The students first use the root-locus method to analyze and design the controller to meet the design specifications. This is done using the system block diagram developed in the previous laboratories and a MATLAB simulation that the students have to create. After the root-locus analysis the computed gains are used to implement the controller using the mechanical and analog units. The necessary circuit is constructed and the gains are adjusted to the values computed using MATLAB. The system response is captured with the oscilloscope and measured to verify the design. Laboratory 12: In this laboratory session the students implement an analog speed control

system with a PI controller. They first use the root-locus method to analyze and Page 4.478.7 design the controller for the design specifications. Then they implement the system using the analog and mechanical units. The gains of the hardware are set to those computed during the design process using MATLAB. After the designed controller is implemented the response of the hardware is verified using an oscilloscope. Finally, the effect of load disturbance on the system performance is investigated. The mechanical unit has a magnet that can be engaged to the output shaft of the unit. The magnet introduces an additional load on the shaft simulating load disturbance. The effect of integral gain on the system response with disturbance is studied by changing the gain settings and observing the system. Laboratory 13:This laboratory session involves the design of a digital speed control system with a PI controller. The students first formulate the difference equations to be programmed by using the transfer function of the analog PI controller designed in the previous laboratory. Tustin's and Euler's approximations are used to convert the continuous-time controller into a digital controller. Then a program is written to implement the digital controller using QuickBASIC and the DAQ board. The response of the mechanical unit under the control of the written program is measured using an oscilloscope. This is followed by an experimental study of the effect of load disturbance on the controller performance. Finally, actuator saturation and its effect on the controller performance is studied. The DAQ board used in the experiment can only provide control voltages to the system in the range of +/- 5VDC. If the PI control algorithm computes a signal that is outside this range the DAQ board saturates. The saturation becomes especially important when the controller is trying to respond to load disturbances.

First Offering Of The Course The course was offered for the first time in Spring 1998. It provided an excellent opportunity for the students to learn the theoretical and practical aspects of both analog and digital control systems. After every laboratory session students were asked to comment on the laboratory content and the quality of the handouts given to them and to make suggestions for improvement. These were then taken into consideration to modify the sessions for the next offering of the course in Spring 1999. In general, the student comments were quite favorable. Many of them reported that the experiments helped them understand the abstract concepts of control theory. The laboratory enabled them to make the connection between the theoretical concepts such as underdamped response and what they correspond to in real world applications.

As mentioned earlier, the primary advantage of teaching a course like ME 375 is that the students are exposed to the theory and practice of both analog and digital control systems in a single course. This is a major improvement since the original curriculum of the degree program contained only an analog controls course with no laboratory. In fact, in many universities the undergraduate curriculum has a single analog controls course with no laboratory.

The difficulty in teaching ME 375 was the necessity to use the two lecture hours a week very Page 4.478.8 efficiently to be able to get through the material given in Table 1. As a result, in some of the lectures there was not enough time to slow down the pace to accommodate students with a relatively weak mathematical background. These students had to be supported by the instructor outside the lecture hours.

The laboratory experiments were developed while the course was being offered. This gave a chance to tightly integrate the experiments to the lecture material covered each week. In some cases, the experiments were designed to address questions asked during the lectures of that week. At the same time it was quite difficult to develop the experiments while offering the course because sometimes hardware problems arose. The experiments are compiled into a 165- page laboratory manual. It explains in great detail each experiment, the associated theory, how to set up the hardware and software.

In the second offering of the course in Spring 1999 a laboratory manual will be given to each student. They will again be asked to comment on each experiment on a weekly basis. The experiments and the laboratory manual will be revised accordingly.

Conclusions In this paper a hybrid analog/digital undergraduate control systems course with laboratory experiments is presented. The combined theory of analog and digital control systems as well as the laboratory experiments enable the students to learn the most fundamental concepts of both theories in a single course.

The author is currently developing a WWW site where the laboratory manual and detailed information about the course can be accessed.

Acknowledgement This work has been partially supported by the National Science Foundation's Division of Undergraduate Education through grant DUE-9796330 and by Washington State University.

References [1] Kheir, N. A. et. al., "Control Systems Engineering Education," Automatica, vol. 32, no. 2, pp. 147-166, 1996. [2] Jacquot, R. G., Modern Digital Control Systems, Marcel Dekker Inc., 1994. [3] Astrom, K. J. and Lundh, M., "Lund Control Program Combines Theory with Hands-On Experiences," IEEE Control Systems Magazine, June 1992. [4] Ozguner, U., "Three-Course Control Laboratory Sequence," IEEE Control Systems Magazine, April 1989. [5] Maurice, F. et. al., "Computer-Controlled Laboratory Experiments." Computer Applications in Engineering Education, Vol. 4, no. 1, pp. 27-33, 1996. Page 4.478.9 [6] Hagan M. T. and Latino, C. D., "A Modular Control Systems Laboratory," Computer Applications in Engineering Education, Vol. 3, no. 2, pp. 89-96, 1995. [7] Shoureshi, R., "A Course on Microprocessor-Based Control Systems," IEEE Control Systems Magazine, June 1992. [8] Mansour, M. and Schaufelberger, W., "Software and Laboratory Experiments Using in Control Education," IEEE Control Systems Magazine, April 1989.

HAKAN GUROCAK is Assistant Professor in the WSU School of Mechanical and Materials Engineering. He received his Ph.D. degree from Washington State University at Pullman in 1993 and has five years of professional experience in teaching undergraduate mechanical engineering. His research interests are robotics, automation, fuzzy logic and haptic interfaces. Page 4.478.10