0% found this document useful (0 votes)
25 views

Real-Time Computer Control Systems

This document discusses the design and implementation of microcomputer software for real-time applications, particularly focusing on digital filtering and control algorithms. It details the programming approaches using C and assembly language, along with performance evaluations of various microcomputers. The findings suggest that while high-level languages like C enhance design flexibility, assembly language offers better execution speed for real-time control systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
25 views

Real-Time Computer Control Systems

This document discusses the design and implementation of microcomputer software for real-time applications, particularly focusing on digital filtering and control algorithms. It details the programming approaches using C and assembly language, along with performance evaluations of various microcomputers. The findings suggest that while high-level languages like C enhance design flexibility, assembly language offers better execution speed for real-time control systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
MICROCOMPUTER SOFTWARE FOR REAL-TIME APPLICATIONS By 5 G. Perdikaris, D. Catapano, E. Jackson, and S. Lesavich = University of Wisconsin-Parkside P.O. Box 2000 Kenosha, Wisconsin 53141 ABSTRACT The organization and design characteristics of software for # rent rate application are presented. A general purpose algoritim custabie for signal = processing or computer control is described. Inplenentarsond ‘of the algo- = Pithe using the language C, assembly language, and assembly Langusge and C cite eeidtred. Performance characteristics obtained experimentally are evaluated. INTRODUCTION The main objective of this paper is the development of an appropriate software schene for iuplenenting digital filtering and/or computer contro? Sigorittms in the leboratory. The justification for the programing concepts, olecented stems from the belief that recent advances and continued Sapfove’, Pregentes jcrocomputer technology, coupled with the advantages offered by digi- 2 ment iteering/control, will result in considerable increase of real-time applications. [1], {2} cae teatiy speaking, a computer control system consists of the plant to be controlled, the digital control lav or algorithm stored in the computer, and Che computer itself with its associated software and interface hardware. Such che cones yeten ie shown in Figure 1 where Gc(z) and Gp(s) represent the dig Seal controller and plant transfer functions, respectively. In addition, © iterecents the reference input, the actuating error signal, = the manipul: representable, and ¢ the controlled variable or output. The computer inter Enee way consist of Analog-to-Digital and Digital-to-Analog converters oF other types of suitable devices CONTROLLER Dac (ZOH) PLANT m(k) m(t) rk) + e(k) Fig. 1, Block diagram of digital control system. MOTOR-CON + OCTOBER 1986 PROCEEDINGS 431 ee flowchart can be calculated ahead of time. When the program is first started, for dnetance, the term SUM is cleared and the new SUM is calculated for the next interrupt as soon as the present manipulation is moved out. This scheme enoures that the time between sampling the plant output and sending out the new manipulation is kept to a minimum. 3. PROGRAM IMPLEMENTATIONS ‘The programming schene illustrated in Figure 2 was implemented on @ pop-11/23 16-bit computer that has hardware multiply and divide instructions. For ease and convenience, the coding was first done in the high-level lan- guage C, Tt required the PDP-11 2.5 msec to implement the Sth-rder algorithm of Bq. (2). Next, for speed and efficiency, the coding was done using integer arith~ metic and assembly language. Yor this implementation, it took the PDP-11 0.82 msec to implement the Sth-order algoritim. Finally, the coding was done using assembly and integer arithmetic for the foreground (algorithm), and C for the background. This PDP-11 implenen- tation required 0.83 msec, which in only 10 microseconds more than the a11- assembly implementation. ‘An all-C implementation of the Sth-order controller on a 10 Miz Motorola 68000 microcomputer system required 0.880 msec. On the other hand, an all- jenbly implementation on the same Motorola microcomputer required 0.18 msec Ghile on all-assembly implementation on a 10 MHz Intel 8086 microcomputer re- quired 0.33 msec. [3] {f the control algorithm was of 3rd rather than 5th order, the all— assembly coding for the three microcomputers required the following execution times: 0.6 msee for the PDP-11/23, 0.14 msec for the Motorola 68000, and 0.23 msec for the Intel 8086. 4. CONCLUSIONS The control algorithm of Eq. (1) 4s versatile and practical for imple- menting controllers of Sth-order or less. This controller may be used as ie or it may be easily modified to handle such special purpose controllers, for fnstance, as the Proportional-Integral-Derivative (PID) ‘Programing a control algorithm in a high-level language such as C al— lows a designer nore time to concentrate on the control problem itself rather than on the implementation of the algorithm. It also provides portability. If speed of execution is an important consideration, however, then integer arithmetic and assembly, or C and assenbly become attractive alternatives. 5. REFERENCES 1. KUO, B.C., Digital Control Systems, Holt, Rinehart and Winston, 1980. 2, PHILLIES, C.L., and NAGLE, H.T., Digital Control Systems Analysis and Design, Prentice-Hall, 1984. 3. BLAIR, R-A., and PERDIKARIS, G.A., A Microcomputer System for Motor Drive Applications, Proc. of the PCI/MOTORCON ‘84 Conference, April, 1984. MGTOR-CON + OCTOBER 1988 PROCEEDINGS 433 To implement the control scheme of Figure 1, the computer samples the output of the plant every T seconds, and then converts the sampled value to an internal representation appropriate for the particular computer. Next, the error signal is determined and fed into the control algorithm to calcu- late the manipulation value. Finally, the manipulation is sent to the pro- cess via the DAC. It 1s important that all the previous events are calculated in a period of time which is small in relation to the sampling time T in order for the control application to be successful and efficient. It is equally important that any precision problems are properly addressed and taken into consider: ton by the software designer. 2. AN APPLICATION PROGRAM An algorithm for solving the digital control problem in the laboratory is described by the flowchart of Figure 2. The depicted solution is designed with flexibility and efficiency in mind. The assumed form of the digital controller is given by its 5th-order transfer function (grays + cass, = Hsz9) Gz) = , qa) x + +852) where Ag-As and Bj-Bs represent the controller coefficients. Equivalently, the difference equation form of the control law is My = ge, + Are cer + oe + A5ey 5) + Bom s) + @ ~ Gy + Be + ‘The computer program that implements the control scheme of Figure 1 is coded from the flowchart of Figure 2. The system reference may come from the keyboard (TTY) or from the ADC. The latter feature makes it possible, for instance, to evaluate the frequency characteristics of the complete system by simply using as reference the sampled output of a signal generator. Further~ more, if the feedback is "disconnected", the same scheme can be used for open-loop control or for digital filtering applications. Keyboard input includes the sign of the plant output, the maximum value or limit allowed for the manipulation variable, the sampling time T, and the controller parameter values. After the initial input of data, the program enters the command mode in which any of the parameter values may be examined or changed in real time. Typing a G (for GO) starts the real-time control process while typing an S (for STOP) interrupts it. ‘The new manipulation, as defined by the control law, is calculated with- in the clock service routine. All other functions, such as changing or ex- amining parameter values, are of lover priority and are performed in the background as the clock is interrupting. ‘As can be seen from Eq. (2), the only tem of the difference equation that depends on the present time is the product Age,. All other terms depend on previous values of m and e. This suggests that the term SUM shown in the 432, MOTOR-CON + OCTOBER 1985 PROCEEDINGS LOCK WTERRUET a oy trot ie —_— ‘panoven one Sone Ree Aan E2eaanese| Ae bet annes iki wax Eoeee usewe Eanes marks Figure 2. Flowchart for Implementing Digital Control Algorithm. 434 MOTOR-CON + OCTOBER 1985 PROCEEDINGS OFFICIAL PROCEEDINGS OF THE SEVENTH INTERNATIONAL MOTGRGON ’85 CONFERENCE OCTOBER 21-25, 1985 CHICAGO ILLINOIS MOTOR-CON + OCTOBER 1985 PROCEEDINGS 1

You might also like