+ All Categories
Home > Documents > A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

Date post: 24-Sep-2016
Category:
Upload: gerard
View: 216 times
Download: 3 times
Share this document with a friend
11
IEEE TRANSACTIONS ON EDUCATION, VOL. E-25, NO. 1, FEBRUARY 1982 uate female that women are being hired for challenging posi- tions at very good salaries. CONCLUSION It is the responsibility and the desire of technical colleges to graduate a sufficient number of well-qualified female students to satisfy the growing industrial demand [5]. The curriculum adaptations, recruiting techniques, and support systems dis- cussed in this article are important means of encouraging fe- males to complete degree programs in technology. Some inno- vations may be costly and complex, others may be inexpensive and elementary, but they are all essential to help compensate for years of discrimination against women in technical fields. REFERENCES J. Giele, Women and the Future. New York: Free Press, 1976, p. 267. L W. Hyde, Connecticut State Technical Colleges, Hartford, CT, private communication, Feb. 1980. N. Kidd and G. Hudson, "Single sex counseling groups and mini courses for women students," J. CoIL Student Personnel, pp. 483-484, Nov. 1978. [41 Women in Selected White Collar and Blue Collar Non-Traditional Occupahons. Women's Bureau, U.S. Dep. Labor, Washington, DC, 1980. [51 Preliminary Draft ofMaster Plan for Higher Education in Con- nectcut 1974, 1979. State CT Comm. Higher Educ., Hartford, CT, Doc. 17. Phyllis S. Katz received the B.A. degree from Connecticut College, New London, CT and the M.Ed. degree from the University of Hartford, West Hartford, CT. She is presently an Assistant Professor and Chairperson of the Department of English at Ward Technical College, University of Harford, where she developed and introduced a program in technical communication. Ms. Katz is a member of numerous profes- sional societies including the Association of Teachers of Technical Writing, National Council of Teachers of English, and the Society for Technical Communication. She is on the Executive Committee of the Central Connecticut Chapter of the Society for Technical Communication. A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory ROMANO M. DE SANTIS, RICHARD HURTEAU, AND GERARD AUTHIE Abstract-An angular position servosystem made of a dc servomotor controlled by a TM990 microcomputer is described. The objective is to offer a control laboratory demonstratorI for the study of a number of questions concerning computer control theory and practice. The con- trol strategy uses state feedback and can be chosen to be either of the Kalman regulator type or of the bang-bang relay type; the parameters of these strategies such as gain, threshold, quantization levels, and sampling frequency can be selected via appropriate teletype commands. The evaluation of the state can be made in three different ways: a direct position and speed measurement, a direct measurement of the position followed by the computation of the derivative to obtain the speed, and the use of a Kalman-Bucy observer. The computer program is written in Basic. Manuscript received May 12, 1980;revised January 17, 1981. R. M. De Santis and R. Hurteau are with the Ecole Polytechnique de Montrial, Montreal, P.Q., Canada. G. Authie is with the Laboratoire d'Automatique et d'Analyse des Systemes, Institut National des Sciences Appliqu6es, Toulouse, France. 1 An improved version of the demonstrator is available and can be obtained upon request to the authors. INTRODUCTION THE graduate/undergraduate university control laboratory Tdemonstrator that we have developed is represented in Fig. 1. It consists of a dc motor controlled by a TM9900 microcomputer. The components of the controlled system are specified in Table I; Table II lists the microcomputer compo- nents; the physical parameters of the controlled system are given in Table III. Reference [1] by Auslander, Takahashi, and Tomizuka provides a good entrance to the literature on direct digital control systems of this type. To make the system work, the operator specifies on the tele- type the desired angular position, the control strategy, and the parameters' values characterizing such a strategy. The com- puter program offers the choice between either a nonlinear strategy implementing the switching curve of an industrial relay (f(KivI + K2v2) = N(a), o = K1 v1 + K2v2, N(a), as 0018-9359/82/0200-0018$00.75 i) 1982 IEEE [1] [21 131 18
Transcript
Page 1: A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

IEEE TRANSACTIONS ON EDUCATION, VOL. E-25, NO. 1, FEBRUARY 1982

uate female that women are being hired for challenging posi-tions at very good salaries.

CONCLUSION

It is the responsibility and the desire of technical colleges tograduate a sufficient number of well-qualified female studentsto satisfy the growing industrial demand [5]. The curriculumadaptations, recruiting techniques, and support systems dis-cussed in this article are important means of encouraging fe-males to complete degree programs in technology. Some inno-vations may be costly and complex, others may be inexpensiveand elementary, but they are all essential to help compensatefor years of discrimination against women in technical fields.

REFERENCESJ. Giele, Women and the Future. New York: Free Press, 1976, p.267.L W. Hyde, Connecticut State Technical Colleges, Hartford,CT, private communication, Feb. 1980.N. Kidd and G. Hudson, "Single sex counseling groups and minicourses for women students," J. CoIL Student Personnel, pp.483-484, Nov. 1978.

[41 Women in Selected White Collar and Blue Collar Non-TraditionalOccupahons. Women's Bureau, U.S. Dep. Labor, Washington,DC, 1980.

[51 Preliminary Draft ofMasterPlan for Higher Education in Con-nectcut 1974, 1979. State CT Comm. Higher Educ., Hartford,CT, Doc. 17.

Phyllis S. Katz received the B.A. degree fromConnecticut College, New London, CT and theM.Ed. degree from the University of Hartford,West Hartford, CT.She is presently an Assistant Professor and

Chairperson of the Department of English atWard Technical College, University of Harford,where she developed and introduced a programin technical communication.Ms. Katz is a member of numerous profes-

sional societies including the Association ofTeachers of Technical Writing, National Council of Teachers of English,and the Society for Technical Communication. She is on the ExecutiveCommittee of the Central Connecticut Chapter of the Society forTechnical Communication.

A Real-Time Computer Control Demonstrator forUse in a University Control Laboratory

ROMANO M. DE SANTIS, RICHARD HURTEAU, AND GERARD AUTHIE

Abstract-An angular position servosystem made of a dc servomotorcontrolled by a TM990 microcomputer is described. The objective is to

offer a control laboratory demonstratorI for the study of a number of

questions concerning computer control theory and practice. The con-

trol strategy uses state feedback and can be chosen to be either of the

Kalman regulator type or of the bang-bang relay type; the parametersof these strategies such as gain, threshold, quantization levels, andsampling frequency can be selected via appropriate teletype commands.The evaluation of the state can be made in three different ways: a

direct position and speed measurement, a direct measurement of the

position followed by the computation of the derivative to obtain thespeed, and the use of a Kalman-Bucy observer. The computer programis written in Basic.

Manuscript received May 12, 1980;revised January 17, 1981.R. M. De Santis and R. Hurteau are with the Ecole Polytechnique de

Montrial, Montreal, P.Q., Canada.G. Authie is with the Laboratoire d'Automatique et d'Analyse des

Systemes, Institut National des Sciences Appliqu6es, Toulouse, France.1An improved version of the demonstrator is available and can be

obtained upon request to the authors.

INTRODUCTION

THE graduate/undergraduate university control laboratory

Tdemonstrator that we have developed is represented inFig. 1. It consists of a dc motor controlled by a TM9900microcomputer. The components of the controlled system are

specified in Table I; Table II lists the microcomputer compo-

nents; the physical parameters of the controlled system are

given in Table III. Reference [1] by Auslander, Takahashi,and Tomizuka provides a good entrance to the literature on

direct digital control systems of this type.To make the system work, the operator specifies on the tele-

type the desired angular position, the control strategy, and theparameters' values characterizing such a strategy. The com-

puter program offers the choice between either a nonlinear

strategy implementing the switching curve of an industrialrelay (f(KivI + K2v2) = N(a), o = K1 v1 + K2v2, N(a), as

0018-9359/82/0200-0018$00.75 i) 1982 IEEE

[1]

[21131

18

Page 2: A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

DE SANTIS et al.: REAL-TIME COMPUTER CONTROL DEMONSTRATOR

Control system

I Fly wheel lr I 'I I,

Graphic outputI- - - - - - -Ir4 1X-Y RecorderI

_ _ _

I

I _ J

Fig. 1. The computer control system configuration.

T

Fig. 2. Illustration of the regulator strategy. Kalman: f(Klvl + K2v2) = K1vj + K2V2. Relay: f(K1v1 + K2V2) =N(a),a =K1v, +K2V2.

TABLE IOPEN-LOOP SYSTEM COMPONENTS

a) DC motor with built-in tachometer, Electrocraft.

b) Fly wheel, home made, mass 1189 gr., diameter 10cm.

c) Two channel high speed-recorder, Techni-Rite Electronics Inc., TR722.

d) X-Y Recorder, 7035B Hewlett Packard.

e) Reduction gear: 80: 1, Type N.LA-904-4, Metron Instr. Co.

f) Precision potentiometer, ITC RVI 5/8 - S231: R 3KQ ± 5%,linearity ± .25%.

g) DC power supply, Hewlett-Packard Harrison 6824A.

h) Microcomputer TM 990, Texas Instruments Inc. (see table 2).

indicated in Fig. 3), or a linear strategy of the Kalman regu-lator type: f(K1 v1 + K2V2) =Klvl + K2V2 . The state vector(vI , v2) used in these control laws can be evaluated either bya direct measurement of v, (position) and v2 (speed), or bya direct measurement of v, and a computation of v2 as givenby the derivative of vi. Alternatively, one can make use ofa Kalman-Bucy type observer.The mathematical model of the open-loop system is repre-

TABLE IIMICROCOMPUTER COMPONENTS

Microprocessor Board TM 990/101 M-3

Power supply TM 990/518 A

Analog I/O expansion module TM 990/1241 R

8 Slot Card Cage TM 990/520

Development Basic TM 990/451

Terminal 743 KSR

TABLE IIIOPEN-LOOP SYSTEM PARAMETERS

DC Motor-fly wheel time constant: 160 ms

Power amplifier gain: 4

Ampli-motor-gear-pot gain: .3 sec 1

Ampli-motor-tachometer-attenuiator gain: .18

u

19

Page 3: A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

IEEE TRANSACTIONS ON EDUCATION, VOL. E-25, NO. 1, FEBRUARY 1982

where

u (n) = f [a(n)]

with

a(n)=K, [v1(n)- Ref] +K2v2(n)

and

* A

Fig. 3. Relay switching curve.

sented by the following equations [2], [3]:

[ vi(n + 1)1= (I eTI)rl [v, (n)]

lV2(n1+1)J lo eT/r J Lv2(n)J

+T- (1- e&TIT)r+ K ------------~~ u(n)

e TIT) ju

where

u = voltage applied to the power amplifierVI = Kpx I, with xl = angular position of the motor axis, Kp

a constantr = time constant (-0.16 s)K = 0.24 V-1T = sampling period.

The observer is described by the following equations [4]:

VI (n + 1) 1(1 - eTII)r][v (n)]v2(n 1) 0L e-TIr L2(n)j

+KL- (1 - e~TIT)T]T (1 -eT/r)J

[u (n) + Ko (v I (n) - 'v (n))]where Ko is the gain of the observer.The dynamic behavior of the linear regulator is given by [4]

[v (n+ (I - eTI)T [VI(n)] [T- (1 eTIr)r11) lK

L[v2(n+ e-T1r Lv2(n) L (I e-T/T) _J

f((Jn)

2.5

-2.5

ifa(n)> 2 =PI

D+Hif a(n)< = P4

2

if D =P3 < (n)2

D-H< =P2<2

0

f(u(n - 1)) ifP2<a(n) <PI or P4<u(n)<P3

DESCRIPTION OF THE PROGRAMThe program flowchart is illustrated in Fig. 5; the listing is

given in Appendix I; the program language is Basic [6]. Theinput/output subroutines, Appendix II, although written inmachine language are also called via a basic instruction (CALL);the "ENT" subroutines allows a voltage input between -10 and+10 V to be acquired by the computer; the "CON" subroutinedelivers an output from the computer which is again containedbetween - 10 and +10 V. The system is put into operation byimplementing the following sequence of steps.

* Assemble the test bench as indicated in Fig. 1 and with thecomponents specified in Tables I and II.

* Load the program into the microcomputer.* Specify the desired control strategy.* Specify the parameters related to the desired strategy.* Ask the program to run.

The program will start by reminding the operator to verifythe interconnections between the microcomputer and the

{KI [vl (n) - Ref] + K2 v2 (n)}

KKI [T-(I-e ( -e KK2 [T- ( - e TT)]

,K-(1------------ ----------- - jL-L (- K --------------- Ref

KK (1 e-Tlr) K2( - e Tl'r) + e-TIT V2L (n)_ l1-iTr

where K1 and K2 represent the gains of the regulator.Finally, the dynamic behavior of the nonlinear regulator is

described by [5]

vl(n+1)][ 1 !(l -e-TI)1 [vl(n)1v2(n + 1)J evT/Tv(n)

T-T (1-TT T)

+ KT (1 e -T/,r). u(n)

(1 e-T/,r)

controlled system. It will then ask to specify the source of ourreference signal as well as the sampling period (a multiple of40 ms). The reference signal represents the desired evolutionof the angular position; it will be generated by the microcom-puter if we want a square wave; for other signal waveforms itwill be provided by an external generator. If one chooses thereference signal to be generated by the microcomputer, thenthe program will ask to specify its amplitude (multiples of10 mV) and its time semiperiod (multiples of 40 ms). If theoption of an external generator is preferred, the program will

20

Page 4: A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

DE SANTIS et al.: REAL-TIME COMPUTER CONTROL DEMONSTRATOR

Noise Microprocessor

V<lv2 Measuredstate

| 5 ~~Derivator | V 2

Computedl + 5 ~~~~~~~v1 stateI

; System} ;Control

state law

System Estimatedmodel V2 state

l l--

Fig. 4. The various state evaluation strategies. (a) Direct measurement of v, and v2. (b) Direct measurement of v, fol-lowed by the computation of its derivative. (c) Use of an observer.

Extol yes NoInput, L

Intrnal

AmplI IFrequ

Samplingperiod 7 External ref. Input, G

12Internal ret.Control law

parametersMe

No linear

Threshold 2 Compute ped2M r

Hysteresis2Linear

Obsernatlon 3

NoObszr erver; i

//:\ YYZ v ^ Linear Control

(Observer gaIn Non linear Compte Input, CO

Fig. 5. The program flowchart.

ask to connect the output of such a generator on the appro-

priate A/D converter.At this point the operator will have to choose the control

strategy; he will type "I" if he wants a linear regulator, "2"if he prefers a nonlinear regulator. He will then have to spe-

cify whether the state has to be evaluated via the use of an

observer, a direct measurement, or a direct measurement fol-lowed by the computation of a derivative. To have the real-time control enter the action, all that remains to be done is tospecify the parameters' values: K, and K2 in the linear regula-tor case, K1,,K2, A, h in the nonlinear case, and Ko if an ob-server is used.

21

Page 5: A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

IEEE TRANSACTIONS ON EDUCATION, VOL. E-25, NO. 1, FEBRUARY 1982

To better illustrate the overall operation, suppose that we want a square wave reference signal with a 1 V amplitude and a 20 speriod, a sampling period of 80 ms, a linear regulator with K1 = 40, K2 = 20, and a direct measurement of v, and v2. The dia-log with the computer would go as follows.

RUN

CHECK YOUR CONNECTIONSPOSITION IS MEASURED ON CHANNEL 31SPEED IS MEASURED ON CHANNEL 15

NOISE IS MEASURED ON CHANNEL 0THE CONTROL IS AVAILABLE ON DAC 1

CHOOSE THE CONTROL STRATEGY

ENTER THE VALUES COM, J, K, L, SIG IN ACCORDANCE WITH:

COM= 1 IF THE CONTROL LAW IS LINEAR (KALMAN)CoM=2 IF THE CONTROL LAW IS NONLINEAR

J= 1 IF POSITION AND SPEED ARE MEASUREDJ=2 IF POSITION IS MEASURED AND SPEED IS COMPUTED (PD)J=3 IF POSITION IS MEASURED AND AN OBSERVER RECONSTRUCTS SPEED

L=1 IF NO NOISE

L=2 IF NOISE IS MEASURED

SIG= 1 IF INTERNAL REFERENCE SIGNAL USED (SQUARE WAVE)SIG=2 IF EXTERNAL REFERENCE SIGNAL

COM=1 J=1 L=1 SIG=1AMPLITUDE (UNIT= 10MV) AND HALF-PERIOD (UNIT=40MS)AMP= 100 PER=250SAMPLING PERIOD? (UNIT=40 MS)E=2PARAMETERS K2,K1,KO?K2=2 K1=40 K0=0

If one wanted, instead, a sampling period of 80 ms, a reference signal given by an external generator, a nonlinear controllerwith K1 = 1, K2 = 0, A = 50 mV, and h = 200 mV, then the conversation would be as follows.

RUN

CHECK YOUR CONNECTIONSPOSITION IS MEASURED ON CHANNEL 31SPEED IS MEASURED ON CHANNEL 15NOISE IS MEASURED ON CHANNEL 0THE CONTROL IS AVAILABLE ON DAC 1CHOOSE THE CONTROL STRATEGYENTER THE VALUES COM, J,K,L, SIG IN ACCORDANCE WITH:COM=1 IF THE CONTROL LAW IS LINEAR (KALMAN)CoM=2 IF THE CONTROL LAW IS NONLINEARJ= 1 IF POSITION AND SPEED ARE MEASUREDJ= 2 IF POSITION IS MEASURED AND SPEED IS COMPUTED (PD)J=3 IF POSITION IS MEASURED AND AN OBSERVER RECONSTRUCTS SPEEDL=1 IF NO NOISE

L=2 IF NOISE IS MEASUREDSIG= 1 IF INTERNAL REFERENCE SIGNAL USED (SQUARE WAVE)SIG=2 IF EXTERNAL REFERENCE SIGNAL

COM=2 J=1 L=1 SIG=2CONNECT FUNCTION GENERATOR ON CHANNEL 25SAMPLING PERIOD? (UNIT=40 MS)E=2PARAMETERS K 2,K 1,KO ?K2=0 K1=1 K0=0THRESHOLD AND HYSTERESIS (UNIT=0.5 MV, K 1 = 1)D=5 HYS=20

22

Page 6: A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

DE SANTIS et al.: REAL-TIME COMPUTER CONTROL DEMONSTRATOR

i

A * -- 7.---

/

Time

(a)

Time

T 40msT = 160 msT = 400 ms

(b)Fig. 6. Effect of the sampling period T over the step response of a pro-

portional compensator (K1 = 10, K2 = 0)-

-XI \ _

(a)

Hii t {i §§iH tiHi 5

Time Fig. 8. Effect of the sampling period over the phase plane trajectoriesassociated with a relay controlUer.

r,

r -- -I r-- r --I Fi' §t' - '*II lime

Time

Fig. 9. Desired angular position.

K2 = 06K2 = 0-9

(b)Fig. 7. Destabilizing effect of an increase in the derivative feedbackgain in the presence of a large sampling period (T = 400 ms, K1 = 20).

TABLE IVA/D AND D/A CONNECTION DIAGRAMS

Channel Signal

A/D 0 Noise

A/D 15 x2, angular velocity

A/D 25 External reference

A/D 31 xl, angular position

D/A 1 u, control

SOME RESULTS

The experimental setup discussed in this paper represents an

ideal test bench to illustrate a number of both theoretical andpractical questions related to computer control engineeringpractice. It allows us to compare, in a clear and convincingfashion, the advantages and disadvantages of various controlstrategies, the importance of the parameter's value utilized ina specific strategy, the influence of the open-loop system dy-namics over the performance of the closed-loop system2 thedeterminant role played by the sampling period, the impor-tance of the quantization levels, the difficulties of implement-ing a proportional + derivative (PD) compensator in thepresence of noise, the noise influence, the improvementattainable by the use of an observer, etc.

Some of these points are illustrated in Figs. 6-10. Fig. 6shows the effect of the sampling period T over the step re-

sponse obtained in correspondence with a PD compensator.

Angularposition

x 1

xl

Controlu X 1

xl

X i

Angularposition

x 1

xl

0

T = 400 ms

Controlu

I.to

X 1

DesiredAngularPosition

=0 7-, e .- _1ig

'l _ r, -~I

-4

kW,\ --.,6

'III N

lb

a

t

I

23

.1 h

Page 7: A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

IEEE TRANSACTIONS ON EDUCATION, VOL. E-25, NO. 1, FEBRUARY 1982

A

Xl

i I

T = 80 ms

1>A T=

Xl

ii

120 ms

Fig. 10. Noise influence on the phase plane trajectories correspondingto the reference signal of Fig. 9. (a) Use of a PD compensator. (b)Kalman regulator preceded by a Kalman-Bucy observer.

(a)

X 1

(b)

U1 -o Time

xl-.i

- Time

(c)

Fig. 11. The role played by the observer gain over the error due toCoulomb friction (K1 = 10, K2 = 0.96). (a) Ko = 10. (b) Ko = 5.(c) Ko = 2.

Fig. 7 illustrates the interesting phenomenon by which, incorrespondence with a large sampling period, an increase inthe derivative feedback gain has a destabilizing, rather thana stabilizing, effect. Fig. 8 shows the phase plane trajectoryof the system in correspondence with a bang-bang controlcharacterized by various sampling periods and hysteresis

values. Fig. 10 allows a comparison between the phase planetrajectory corresponding to a PD controller in the presenceof an additive output noise and the phase trajectory obtainedby replacing the PD controller with a Kalman regulator pre-ceded by a Kalman-Bucy observer. Finally, Fig. 11 illustratesthe role played by the Kalman-Bucy observer gain in cor-

T = 80 ms

Time

Time

24

x.I. IA

ir

Page 8: A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

DE SANTIS et al.: REAL-TIME COMPUTER CONTROL DEMONSTRATOR

respondence with a resistive torque due to the presence of onstrator for a university control laboratory. Its cost, evalu-Coulomb friction in the motor axis. ated at somewhere between $4000 and $5000, although not

negligible, is more than justified by the advantage of having aCLOSURE system made of standard well-documented components, each

one of which can be used for a myriad of other applications inThe proposed setup is easy to implement, convenient to use, the same control laboratory. Its acceptance by our under-

and extremely versatile as a real-time computer control dem- graduate and graduate students has been enthusiastic.

APPENDIX IPROGRAM LISTING

2 PRINT "CHECK YOUR CONNECTIONS"3 PRINT "POSITION IS MEASURED ON CHANNEL 31"4 PRINT "SPEED IS MEASURED ON CHANNEL 15"5 PRINT "NOISE IS MEASURED ON CHANNEL 0"6 PRINT "THE CONTROL IS AVAILABLE ON DAC 1"7 PRINT "CHOOSE THE CONTROL STRATEGY"8 PRINT "ENTER THE VALUES COM, J,K,L, SIG IN ACCORDANCE WITH9 PRINT "COM=1 IF THE CONTROL LAW IS LINEAR (KALMAN)"10 PRINT "COM=2 IF THE CONTROL LAW IS NONLINEAR"11 PRINT "J= 1 IF POSITION AND SPEED ARE MEASURED"12 PRINT "J= 2 IF POSITION IS MEASURED AND SPEED IS COMPUTED (PD)"13 PRINT ".=3 IF POSITION IS MEASURED AND AN OBSERVER RECONSTRUCTS SPEED"

16 PRINT "L = 1 IF NO NOISE"17 PRINT "L = 2 IF NOISE IS MEASURED"20 PRINT "SIG= 1 IF INTERNAL REFERENCE SIGNAL USED (SQUARE WAVE)"21 PRINT "SIG=2 IF EXTERNAL REFERENCE SIGNAL <OA>"25 INPUT %1, "COM=";COM,"J=";J,"L=";L," SIG=";SIG30 IF SIG=2 THEN PER=0:: REF=O:: GOTO 4232 PRINT "AMPLITUDE (UNIT=10MV) AND HALF-PERIOD (UNIT=40MS)"40 INPUT "AMP=";AMP," PER =";PER41 REF=AMP:: GOTO 4342 PRINT "CONNECT FUNCTION GENERATOR ON CHANNEL 25",43 PRINT "SAMPLING PERIOD ? (UNIT=40 MS)"50 INPUT "E=";E52 PRINT "PARAMETERS K2,K 1, K0 ?"60 INPUT "K 2=";K2," K 1 ";K1," KO=";KO65 ADD=6000H70 BASE 0100H:: CRB[01=0:: CRB[71=175 TIME 0, 0, 080 IF COM=1 THEN HYS=O:: D=O:: GOTO 16082 PRINT "THRESHOLD AND HYSTERESIS (UNIT=0.5 MV, K1=1)"90 INPUT "D=";D," HYS="; HYS92 REM**********************************************************************95 REM PARAMETERS OF THE RELAY97 REM**********************************************************************100 P1=INP[(D-HYS)/2J110 P2=INP[(D+HYS)/21120 P3=-P1130 P4=-P2160 X=0:: X2=0:: U=512:: X00:: BRU=O165 IMASK 7:: TRAP 7 TO 2020170 IF J< > 3 THEN GOTO 245172 REM* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *175 REM - -PARAMETERS OF THE OBSERVER .....................

177 REM***********************************************************

25

Page 9: A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

IEEE TRANSACTIONS ON EDUCATION, VOL. E-25, NO. 1, FEBRUARY 1982

180 F22=EXP[-E/41190 Cl=l-F22200 F12=0.16*C1210 G1=0.24*(0.04*E-F12)220 G2=0.24*C1230 K3=2.4*K2

240 C2=10/2048:: X1=0:: X2=0:: U1=0:: UOB=O245 ON J THEN GOTO 250,600,900246 REM* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

247 REM.. . . . .POSITION AND SPEED MEASURED . . . . . .

248 REM*********************************************************************250 H=TIC[0l260 S=TIC [0°270 IF TIC [H] <>E THEN GOTO 270280 H=TIC[0J300 CALL "POSITION", 04000H,ADD,31, (X)320 CALL "NOISE", 04000H, ADD, 0, (BRU)330 IF SIG THEN GOTO 360350 CALL "REFERENCE", 04000H,ADD,25, (REF)360 ERR=X+1024+(L-1)*BRU-REF380 CALL "SPEED", 04000H,ADD,15, (X2)400 B1=INP[K1*ERR+K2*X2]410 IF COM=2 THEN GOTO 460420 U=B1430 IF U>2047 THEN U=2047440 ELSE IF U<-2048 THEN U=-2048450 GOTO 490460 IF B1>=P2 THEN U=512470 ELSE IFB1<=P4 THEN U=-512480 ELSE IF (B1<P1 AND U=512) OR (B1 >P3 AND D=-512) THEN U=0490 CALL "CONTROL", 04020H, ADD, 1,U500 IF TIC[ SI <PER THEN GOTO 270510 REF=-REF:: GOTO 260585 REM * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

590 REM.. . . . . . .POSITION MEASURED - SPEED COMPUTED PD . . . ..-.. . . . .

595 REM****************************************************

600 H=TIC[0I610 S=TIC[0J620 IF TIC [HI <>E THEN GOTO 620630 H=TIC[0J650 CALL "POSITION", 04000H,ADD,31, (X)670 CALL "NOISE", 04000H,ADD,0, (BR U)680 IF SIG THEN GOTO 710700 CALL "REFERENCE", 04000H,ADD, 25, (REF)710 ERR=X+ 1024+(L-1)*BRU--REF720 X2=60*(X-X0)/E730 XO=X740 B1=INP[K1*ERR+K2*X2J750 IF COM = 2 THEN GOTO 800760 U=B1

770 IF U>2047 THEN U=2047780 IF U<-2048 THEN u=-2048790 GOTO 830800 IF B 1 >=P2 THEN U= 512810 ELSEIFB1<=P4 THEN u=-512820 ELSE IF (Bl<Pl AND U=512) OR (B1>P3 AND U=-512) THEN U=0830 CALL "CONTROL", 04020H,ADD, 1,U840 IF TIC [SI <PER THEN GOTO 620

26

Page 10: A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

DE SANTIS et al.: REAL-TIME COMPUTER CONTROL DEMONSTRATOR

850 REF=-REF:: GOTO 610

885 REM*********************************************************************890 REM.. . . . .POSITION MEASURED.. . . . . . OBSERVER ........................

895 REM*********************************************************************900 H=TIC[0I910 S=TIC[01920 IF TIC (HI <>E THEN GOTO 920

930 H=TIC[01950 CALL "POSITION", 04000H,ADD,31, (X)

970 CALL "NOISE", 04000H,ADD,0, (BRU)

980 IF SIG THEN GOTO 10101000 CALL "REFERENCE", 04000H,ADD,25, (REF)

1010 ERR=X+ 1024+(L -1)*BRU-REF1020 X1=X1+F12*X2+G1*UOB1030 X2=F22*x2+G2*UOB1040 U1=-K1*(X1-REF*C2)-K3*C21060 B1=-INPU1l*204.811070 IF COM=2 THEN GOTO 11201080 U=B 11090 IF U> 2047 THEN U=20471100 IF U<-2048 THEN u=-20481110 GOTO 11501120 IF B1>=P2 THEN U=5121130 ELSEIFB1<=P4 THEN U=-5121140 ELSE IF (B1 <P1 AND U=512) OR (B1>P3 AND U=-512) THEN U=0

1150 CALL "CONTROL", 04020H,ADD,1,U1151 A=INP[X1 *204.81:: CALL "ESTIMATED POSITION", 04020H,ADD,2,A

1155 Ul=-U*C21156 UOB=U1+KO*( (X+1024)*C2-X1)1160 IF TIC [SI <PER THEN GOTO 9201170 REF=-REF:: GOTO 9101195 REM* ************* ***************** * ** * ************ * * * ** * ********* * * * ** *

2000 REM. MODIFICATION OF PARAMETERS . . ...........................

2005 REM********************************************************************2020 CALL "CONTROL", 04020H,ADD,1,02030 PRINT "WHICH PARAMETER DO YOU WANT TO MODIFY ?"

2040 PRINT "IF NO MORE MODIFICATIONS ARE REQUEST, WRITE END"

2050 INPUT #3,$C2060 IF $C="COM" THEN INPUT " COM=";COM2070 ELSE IF $C= "J" THEN INPUT J= ";J2080 ELSE IF $ C= "K " THEN INPUT K =";K2090 ELSE IF $C="L" THEN INPUT "L=";L2100 ELSE IF $C="SIG" THEN INPUT "5SIG=";SIG2110 ELSE IF $C="AMP" THEN INPUT "AMP=";AMP:: REF=AMP

2120 ELSE IF $C="PER" THEN INPUT PER=";PER

2130 ELSE IF $C="K2" THEN INPUT "K2=";K22140 ELSE IF$C="K1" THEN INPUT"K1=";K 12150 ELSE IF $C="KO" THEN INPUT"K0=";KO2160 ELSE IF $C="D" THEN INPUT "D=";D

2170 ELSE IF $C="HYS" THEN INPUT " HYS=";HYS2180 ELSE IF $C="E" THEN INPUT "E=";E

2190 IF $C<> "END" THEN GOTO 20502200 GOTO 100

27

Page 11: A Real-Time Computer Control Demonstrator for Use in a University Control Laboratory

IEEE TRANSACTIONS ON EDUCATION, VOL. E-25, NO. 1, FEBRUARY 1982

APPENDIX IIINPUT-OUTPUT SUBROUTINES

Input-output subroutines are located on EPROM memorystarting with the hexadecimal address 4000.

Input Subroutine:

Call Statement: CALL "ENT", 04000H,R4,R5,(R6)Parameters: "ENT": identification of the subroutine

04000H: hexadecimal address of the loca-tion in memory at which theroutine resides

R4:

R5:

R6:

base address of the interface asselected at the dip socket on theboard (06000H)analog-digital converter (ADC)channel (between 0 and 31)address of stored ADC data.

InstructionMOVR5, @> 8(R4)

CommentSelect Channel

MOV @ C(R4),R7

CRL@A(R4)

INCT R 6WAIT INV *R 7

JLT WAIT

MOV@>E(R4), *R6

Starting ADC

Waiting end ofconversion.

RT

Output Subroutine:

Call Statement: CALL "CON", 04020H, R4, R 5,R 6

Parameters: "CON": identification of the subroutine04020H: hexadecimal address of the loca-

tion in memory at which theroutine resides

R4: base address of the interface(06000H)

R 5: digital-analog converter (DAC)(1 or 2)

R6: DAC data.

Output Subroutine Listing:

InstructionAORG >20SRAR5, 1

JNC CONVINCTR 4

CONV MOVR 6, *R 4RTEND

Comment

IF CARRY=0, DAC 2DAC 1 is chosen.

REFERENCES

[1] D. M. Auslander, Y. Tukahashi, and M. Tomizuka, "Direct digitalprocess control; Practice and algorithms for microprocessorapplication," Proc. IEEE, voL 66, pp. 199-208, Feb. 1978.

[2] Electro-Craft Corporation, DCMotors Speed Controls SerpoSystems. New York: Pergamon, 1977, ch. 2, pp. 2-16-2.28.

[31 D. K. Frederick, and A. B. Carlson, Linear Systems in Communi-cations and Control. New York: Wiley, 1971, ch. 13, pp. 495-546.

[4] B.D.O. Anderson and J. B. Moore, Linear Optimal Control.Englewood Cliffs, NJ: Prentice-Hall, 1971, ch. 8, pp. 145-191.

[5] R. Graham and X. McRuer, Analysis ofNonlinear Control Sys-tems. New York: Wiley, 1961.

6] Texas Instrument, Inc., TM990 Power Basic Reference Manual,Houston, TX, 1978.

.ill Romano M. De Santis received the D.Sc. degreein electrical engineering from the University ofRome, Rome, Italy, in 1963, and the M.Sc. andPh.D. degrees in computer information andcontrol engineering from the University ofMichigan, Ann Arbor, in 1969 and 1971,respectively.Currently, he is a Professor in the Department

of Electrical Engineering of the Ecole Polytech-nique de Montr6al, Montreal, P.Q., Canada. Hisinterests range from mathematical systems

theory to real-time control of industrial processes.

Richard Hurteau was born in Montreal, P.Q.,Canada, on September 29, 1951. He receivedthe B.Sc.A. degree in electrical engineeringfrom the Ecole Polytechnique de Montreal,Montr6al, P.Q., Canada in 1974 and the Doc-

- teur-Ingenieur degree in control systems fromthe Universite Paul Sabatier, Toulouse, France,in 1977.Since 1977 he has been an Adjoint Professor

-, @ 2with the Department of Electrical Engineeringof the Ecole Polytechnique de Montr6al. His

interests range from large-scale systems theory to real-time control ofindustrial processes.

Gerard Authie was born in France on August|| _ 11, 1945. He received the degree in electrical

engineering and automatic control from theInstitut National des Sciences Appliqu6es(I.N.S.A.), Toulouse, France and then theDocteur-Ing6nieur degree in electrical engineer-ing and automatic control from the Universityof Toulouse, Toulouse, in 1971.From 1968 to 1972 he was an Assistant in

Electrical Engineering at I.N.S.A. and from1972 to 1973 he served in the French Army as

an Electronics Engineer at the engineering school, ITA, Sao Jose dosCampos, Brazil. From 1975 to 1977 he was a Visiting Professor inElectrical Engineering at the University of Campinas, Sao Paulo, Brazil.He is now an Assistant Professor of Electrical Engineering and Compu-ter Science at I.N.S.A. His major interests are mathematical program-ming, optimization, distributed algorithms, and computer architecture.

Input Subroutine Listing:

AssemblyCodeC9050008C1E4OOOC04E4OOOA05C60557llFE

C5A 4OOOE045B

AssemblyCode

0815170105C4C506045B

28


Recommended