NASA Contractor Report 178210 

USER GUIDE FOR THE DIGITAL CONTROL SYSTEM 

OF THE NASA/LANGLEY RESEARCH CENTER'S 13-INCH 

MAGNETIC SUSPENSION AND BALANCE SYSTEM 

Colin P. Britcher 

OLD DOMINION UNIVERSITY RESEARCH FOUNDATION 

Norfolk, Virginia 

Contract NASl- 17993 

Task Authorization No. 24 

March 1987 

? 

. 

National Aeronautics and 

Space Administration 

Langley Research Center 

Hampton, Virginia 23665 
TABLE OF CONTENTS 

Page 

. 

1 . INTRODUCTION ............................................ 1 

2 . CONTROLLER CONCEPTS ..................................... 5 

2.1 Control Algorithms ................................. 5 

2.2 Software Block Structure ........................... 8 

2.3 Data Array Format .................................. 11 

2.4 1/0 Filtering ...................................... 13 

3 . SYSTEM CONFIGURATION .................................... 15 

3.1 Position Sensors ................................... 15 

3.2 Isolation Amplifiers and Current Monitoring ........ 15 

3.3 PDP 11/23+ ......................................... 22 

4 . CONTROLLER USERS GUIDE .................................. 23 

4.1 Hardware ........................................... 23 

4.1.1 Startup .................................. 23 

4.1.2 Closedown ................................ 23 

4.2 Controller Software Operation ...................... 23 

4.2.2 Run-time Screen Display .................. 24 

4.2.3 Run-time Keyboard Commands ............... 25 

4.2.4 Launch and Landing Sequence .............. 28 

4.2.1 Activation of Control Program ............ 23 

4.3 Limitations and Restrictions ....................... 29 

APPENDIX A Compilation. Assembly and Linking of 

Executable Program ............................ 31 

APPENDIX B Example Source Code Listings .................. 34 

APPENDIX C PDP 11/23 Configuration Reference ............. 63 

APPENDIX D Hardware Checkout and Test Procedures ......... 65 

i 
1. INTRODUCTION 

* 

Until relatively recently, all wind tunnel Magnetic 

Suspension and Balance Systems (MSBS) relied exclusively on 

analogue controllers, of rather standardized form, to stabilize 

and control the position and attitude of the suspended model 

(reference 1). In the mid 19701s, MIT began an investigation of 

the feasibility of convertingthe control system of their 6 inch 

MSBS to digital operation, though experimental work progressed 

only as far as a 1 degree of freedom benchtop demonstration 

(reference 2). Later, the University of Southampton MSBS 

controller was progressively digitized and can now only be 

operated in that form, with no provision for analogue reversion 

(references 3,4). Around 1980, the AEDC 13 inch MSBS was 

relocated to NASA Langley Research Center (LaRC) and was 

subsequently turned over to NASA ownership. Commencing in 1984, 

this system, hereafter referred to as the NASA LaRC 13 inch MSBS, 

has been digitized, following fairly closely the methods explored 

at Southampton. 

El ec t rom a a nets Power supplies - 

Shunts 

5 '-1 Utility power A I 

D-A 

'-I \- I \, I _I t, H Computer 1 

Position etc. 

sensors 

Fig.l.1 Typical block diagram of digitally controlled MSBS 

The original motives for investigation of digital MSBS 

controllers included : 

1) Incorporation of more advanced control algorithms. All 

MSBSs, including those operated with digital controllers, have 

1 
utilized broadly similar control strategies. There is no reason 

to believe that these strategies represent the best performance 

that can be achieved and it is strongly felt that design, 

implementation, testing and evaluation of new algorithms will be 

far easier within a digitized controller than otherwise. Advanced 

control strategies are likely to include some self-adaptive 

features. 

MODEL 

STATE DATA) SYSTEM - 

2) Model changes. Controller coefficients (loop gains etc.) 

generally need to be reset or readjusted for each substantially 

different test model. This function is most easily implemented 

via accessing different snftware rn~dclec, rather tha:: by 

mechanical or electrical adjustments. 

FAST LOOP 

TRANS- IC 

CONTROLLER LATOR E/M 

CURRENT 

3) Performance repeatability. Digitized controller sections do 

not suffer from drift, electrical interference etc., and retain 

STATE TUNNEL 

STATE DATA IDENTIFICATION 

E/M CURRENT DATA 

accurate calibrations over unlimited time periods. 

4) Versatility of model position and attitude selection. 

Automatic, pre-programmed or operator driven real-time control of 

model position, attitude and motion has already been achieved 

with an ease which analogue systems could never approach. 

5) Data acquisition. Certain system data (model position, 

attitude and motion) is inherently available within the 

controller. Particularly when dynamic testing or rapid sequencing 

of model position or attitude is envisaged, the high level of 

synchronization required between the data acquisition and control 

functions recommends the complete integration of those functions. 

Further, it is anticipated that advanced algorithms would demand 

a tightly coupled flow of information between the controller and 

data processing functions (reference 5). 

DEMANDS 

- SYSTEM ADAPTIVE IDENT. CONTROL. * 

SLOW LOOP 

AERODYNAMIC 
. 

Development of a comprehensive suite of control software was 

initially undertaken by Bouchalis and Fortescue (reference 3), 

who achieved full 6 component control of winged models. Their 

software was later entirely re-written in a more modular form by 

this author. The software detailed in this report is essentially 

a second re-write, being modified to eliminate certain 

shortcomings of previous versions and to incorporate some more 

sophisticated features. A general comparison of the three suites 

is given in the following Table: 

All software so far written has been implemented using 

dedicated minicomputers, though on two slightly different 

configurations of same : 

................................................................. 

1,II (Southampton University) I11 (NASA/AEDC 13") ________________________________________------------------------- 

PDP 11/34A CPU (see later note) PDP 11/23-PLUS CPU 

Extended Instruction Set Extended Instruction Set 

FP-11 Floating point processor FPF-11 Floating point processor 

28k words memory utilized 28k words memory utilized 

KW-11 programmable clock KW-11 programmable clocks 

Custom built A/D and D/A AAV-11 and ADV-11 A/D and D/A 

subsytem accessed via converters 

single DR-11 digital 1/0 DRV-11 digital 1/0 

RT-11 V4.0 operating system RT-11 V5.0 operating system 

MACRO V4.0 and FORTRAN V2.1 MACRO V5.0 and FORTRAN V2.6 

application software application software ................................................................. 

Due to the extensive commonality of the PDP-11 family, both 

in hardware and software, conversion of software from one 

configuration to another is relatively straightforward. 

The current software is structured in a highly modular form 

in order to simplify the task of incorporating any amendments 

necessary to accommodate different test models, experimental setups or run-time features. Wherever possible, repetitious or 

common coding is accessed via simple calls to Subroutines or 

MACRO library modules. 

execution since CPU speed is the major limiting factor with 

presently available computer hardware. At the loop repetition 

Considerable efforts have been made to streamline program 

3 
rates chosen at Southampton (typically 400 cycles per second), 

the hardware had been pressed close to its limit. Occasionally, 

with special features such as high angle-of-attack operation, 

computations extended beyond the available 1/400 secs, forcing 

reductions in loop rate. The NASA LaRC 13" MSBS can operate at 

lower loop repetition rates (typically 256 cycles per second) due 

to its larger size, hence lower system natural frequencies, but 

still has little spare CPU capacity since the PDP 11/23 is 

marginally slower than the 11/34. Certain desirable real-time 

features, particularly trapping of out-of-range or operator error 

conditions, are therefore not presently practical. 

iu'ote I So..~t~lax,pton *"*liiversfty! ii,.s;A 2P.". has now been 

upgraded to a PDP 11/84, other hardware remaining essentially 

unchanged. This represents a substantial increase in execution 

speed. 

4 
2. CONTROLLER CONCEPTS 

Discussion in the remainder of this report will concentrate 

specifically on the controller hardware and software for the 

NASA LaRC 13" MSBS, though many details are common to the 

Southampton University system. 

2.1 CONTROL ALGORITHMS 

The block diagram of the controller, illustrated in 

Fig.2.l., corresponds to normal MSBS practice although various 

alternative orderings of the blocks are possible. The ordering 

shown is presently found to be the most convenient for digital 

operation. 

PHASE MODEL DEADVANCE GREES OF 

FREEDOM 

MODEL POSITION/ 

ATTITU DE/VELOCITY 

I (PREFILTER)] I I I_ DATA (MAY BE 

FILTERED) 

USER DEMq OFFSETS 

INPUTS 

TRANSLATE 

DEMANDS 

TO E/M 

( TRANSLATOR) 

Fig.2.l Functional block diagram of controller 

The pre-filter and translator serve mainly to permit the 

control algorithms to operate in model degrees of freedom, this 

being thought to be the best approach. The levels of model 

suspension stiffness and stability that can be achieved are 

principally affected by the parameters and performance of the 

phase advance block. Dual series phase advance (lead-lag) stages 

have been widely used in this application (see reference 1) and 

are retained in the digital controller pending provision of any 

superior alternatives. The digital implementation of these stages 

is detailed in the following Section, although, due to the high 

stage gain at high frequencies, these algorithms are viewed as 

being rather unsuited to digital implementation. Nevertheless, 

5 
the qualitative performance, with regard to suspension stiffness 

and stability, of the two digitized controllers operated to date 

is virtually indistinguishable from the best that their analogue 

counterparts could achieve. 

TRANS- K To 

Power 

Supplies 

- 1+- 

LATOR D 

I 11 

- G 

{GI-- - 

Phase advance User demand 

i 

t-- 

Fiq.2.2 Idealized controller transfer functions 

The controller transfer functions are shown in Fig.2.2. and 

may be implemented digitally as follows : 

Prefilter 

Algebraic combination of available position sensor 

data to provide measures of model position and attitude in model 

axes. 

Phase advance 

fashion : 

Configured in a dual series arrangement in the classical 

- where n,T presently have the same value in each stage. 

6 
This is implemented digitally as follows : 

U 1 

1 +TD 

* - 

Z 1 d Y l+nTD - - l+nTD - 

(u2 1 1 +TD 

Approximating for a discrete-time sampled-data system with sample 

interval At, we have : 

4 

U - At 

T A 

T-- - u-y with ny = y(k)-y(k-l) Ay 

- 

Z 

1 +nTD T Y'- 

At( 1 +TD) 

- 

T 

Y(k) N - U(k) + - Y (k-1) 

Thus : At 

T+At T+At 

This differs from the formulation qiven in reference 3 but 

is felt to be more 

Now following 

AY 

At 

z = y + nT - 

appropriate at low sampling rates (At - T) . reference 3 : 

nT 

Giving : z(k) = y(k) + - (Y (k) -Y (k-1) 1 

at 

The above procedures are easily repeated by using z(k) as 

the input (u'(k)) to the second controller block.It is seen that 

storage of one intermediate value (y(k-1)) is required for each 

block of the controller. It happens that slight savings in 

execution time can be made if the transfer function blocks are 

rearranged and a modified form of the first intermediate value 

stored : 

7 
The leading multiplier terms of the two blocks are now 

consolidated into a single operation : 

- - - 

ZI T T Y" - l+nTD - 

T At( 1 +TD) At( 1 +TD) 

-- 

d - l+nTD -IrAdditional gain terms can be agglomorated into the initial 

multiplier if desired. 

Offsets and gains 

Straightforward algebraic adjustments. 

Integrator 

k 

If the value of KAt is relatively small (typically 2*1O -12 ) 

it may be chosen somewhat arbitrarily, with no significant effect 

on controller stability. This has been the usual case. 

2.2 SOFTWARE BLOCK STRUCTURE 

A relatively complex structure for the executable program 

has evolved which seems to provide an appropriate framework for 

the required functions. The program is entered and exited through 

FORTRAN for convenience. In order to preserve sufficient memory 

capacity for storage of real-time data, the executable program 

uses overlays (handled by RT-11) so that surplus code areas can 

be written over by the real-time portion of the controller, as 

shown in Fig.2.3. This real-time portion is structured in four 

8 
layers, as shown in Fig.2.4. 

M S BS. FO R 

(Root segment - Data arrays) 

DATl N 

TTON 

START 

USER10 

CNTROL 

DATOUT 

TTOFF 

Resident segment 

Overlay segment 

Fiq.2.3 Control software overlay structure 

I1MSBS1l performs the necessary system-level software 

initialization (automatically). Storage areas for oscillator, 

preprogrammed command, real-time (keyboard) command and acquired 

data arrays are reserved. All other program functions are handled 

by Subroutines which are called in sequence from MSBS. 

llDATIN1t reads preprogrammed routine data from a disc 

datafile and fills the oscillator array with one cycle of a 

sinewave. 

llTTON1l performs some system hardware initialization and sets 

up a screen display on the VT-102 console terminal. 

*ISTART1l accesses data across the FORTRAN llCALL1l interface 

and sets up certain hardware features, notably the programmable 

clock rate and interrupt status. Some hardware features are reset 

prior to exiting the real-time controller, including reset of all 

D/A channels to safe (zero current) values. These reset functions 

are also performed following certain run-time error conditions, 

prior to returning to the system monitor. 

llUSERIO1l constitutes the only run-time interface between the 

console CRT/keyboard and the controller software. User commands 

are decoded, with some commanded functions performed directly and 

others routed via the user command array IICHARSII. 

whenever the module lfCNTROL1l is required to run. Execution of 

llUSERIO1l resumes after completion of each control loop, but only 

until interrupted again. Interrupts repeat at 256 cycles per 

second (presently), thus a rather small percentage of processor 

time is spent executing this module. 

This module is interrupted (by the programmable clock) 

IICNTROLtl preserves the system state following the hardware 

interrupt, permitting return to the previously executing code in 

llUSERIO1l. All real-time controller, data acquisition and related 

1/0 functions are performed with the previous system state being 

9 
"RUN" FORTRAN module "MSBS" - "STOP" 

Root segment, call subroutines 

t I 

+I I FORTRAN module 

I' DATl N 'I 

t 

MACRO module 

" TTON 'I 

Some system init. 

Set-up CRT screen 

rI 

3 DATA. DAT 

FORTRAN moduie 

'I DATO U T" 

MACRO module 

I 'TTO FF" 

Some system de-init. 

Reset CRT screen 

MACRO module "START" ~ 

Preamble Closedown 

Start clock 

I 

RTS I 1 

I MACRO module "USERIO" e 

I User I/O --, --+IIESC'' 

t I 

256 Hz interrupt RTI 

MACRO module "CNTROL" CNTRLB library 

Real-time controller Real-time 1/0 I I 

Fiq.2.4 Control software block structure 

10 
restored prior to return to llUSERIO1l. 

llTTOFF1l resets the VT-100 screen display. 

llDATOUT1l writes real-time data to a disc datafile if 

required. 

Two library modules are employed to simplify program 

coding. llCONFIG1l provides system hardware configuration 

information and the fixed global assignments for elements of the 

command array CHARS. "CNTRLBII provides MACRO'S for all real-time 

1/0 functions and for many controller functions repeated for each 

model degree of freedom. 

2.3 DATA ARRAY FORMAT 

The array CHARS is the medium by which run-time commands are 

transmitted to the controller and real-time data made available 

for inspection. The format of the array, summarized below, is 

crucial to the program structure and coding. Array addressing is 

based on use of ASCII numerical equivalents, with each array 

element effectively labelled with an ASCII character. It should 

be noted that the array is a subset of the ASCII code set. 

11 
Element offsets are (ASCI18-408) or (ASCIIlo-3210) 

element offset. It is often convenient, therefore, to code 

references to specific array elements in the following form : 

CHARS+<2*110>* = CHARS+<2*72.>10 = Address element 72, ASCII tthtt 

Each element of CHARS corresponds to a command value, realtime data value, program control switch or similar. Full details 

of the assigned functions of each element are given in Section 4, 

but as an example, the contents of element 33 (ASCII A) are 

interpreted as the loop gain of the axial degree of freedom. The 

.contents of all elements may be inspected at run-time from the 

keyboard, but only elements 32 and above may be modified by 

keyboard commands. Any element may be modified by a preprogrammed 

routine, dealt with later in this Section. 

Since CHARS is a word array, the byte offset is twice the 

The OSCILL array is loaded at run-time with a single cycle 

of a sinewave, amplitude 16,383 units, calculated at 1/1024th 

of a cycle increments. With the program loop rate as 256 Hz, the 

minimum usable frequency is 0.25H2, with frequencies of any 

multiple of 0.25 Hz being available. 

Element Contents ..................................... OSCILL I 1 I 16383*Sin (0) I 

I 2 I 16383*Sin (1*360/1024) I 

I 3 I 16383*Sin (2*360/1024) I (angles in 

14 I etc. I degrees) 

I I I 

I I I 

I 1022 I I I 1023 I 16383*Sin (1022*360/1024) I 

I 1024 I 16383*Sin (1023*360/1024) I 

A master counter (ASCII tt-tt, CHARS element offset 9410) is 

set up to tick once per program cycle (256 ticks/second), 

resetting to 0 on every 1024th tick, and provides a reference 

phase and frequency of oscillator. The run-time variable 

frequency and phase feature is implemented by the following 

addressing procedure : 

12 
OSCILL address = [(Master counter* Frequency) + Phase] 

(Truncated to first 10 bits) 

The ICOMM array contains preprogrammed position, attitude 

and motion command data. Four independent routines, each of up to 

80 individual commands, may be utilized, with options for fewer 

routines of greater length, up to the total command limit of 320. 

The format of the array is as follows : 

1st routine 

------------ 

Element 1(1 Duration I 

I (I---------- 

(1st 2( I Value I 

command) { I ---------- I 

3( I Code I 

I---------- I 

(2nd 4( 1 Duration I 

command) (I---------- I 

5(1 etc. I A terminator (Duration=O) is 

usually present, otherwise execution 

proceeds to the next available 

instruction, such as the 1st command 

of the second routine. 

The 1st routine may thus contain 

the 2nd, and so on. 

There is no restriction on access to the CHARS array from a 

preprogrammed routine (contrasting with restricted access from 

the keyboard) but certain keyboard functions do not operate : 

ESC The controller can only be aborted from the keyboard 

Real-time data cannot be displayed automatically 

DEL Not required 

? 

2.4 1/0 Filterinq 

If analogue position sensors, or analogue data-links from 

the position sensors, are used, then some form of analogue 

filtering is necessary at the controller A/D inputs. This 

corresponds to classical anti-aliasing filtering, though it is 

not yet clear whether the anti-aliasing function per se is 

particularly necessary for MSBS controller operation. Typical 

controller sampling frequencies have been at least a factor of io 

above any natural frequency of the suspended model and the 

systems overall response falls very rapidly with increasing 

frequency. Rather, the filtering acts to limit high frequency 

noise at the controller inputs, since the conventional control 

algorithms exhibit high stage gain at high frequencies. The 

NASA LaRC 13" MSBS now has digital datalinks from inherently 

13 
digital Self-scanning Photodiode Array position sensors to the 

controller and appears not to require any form of input 

filtering. The frequency content of the position sensor 

information is naturally limited, of course, by the sampling 

processes inherent in the position sensor operation. 

Modest analogue filtering of the output demands to the 

electromagnet power supplies (via D/A convertors) appears to be 

advisable to avoid problems with conventional thryistor 

power amplifiers, notably the vlbeatingvl of the controller 

repetition frequency with the fundamental or harmonics of the 

thryistor firing frequency. This can be achieved by roll-off of 

the frequency response of the power supply preamplifiers. 

14 
3. SYSTEM CONFIGURATION 

A schematic diagram of the 13Il MSBS laboratory is shown as 

The peripheral processor (KXT-11C) is installed but not 

Fig.3.1, with a block diagram of the MSBS hardware as Fig.3.2. 

Some clarification is necessary. 

presently utilized. The intended function is to serve as an 

intelligent interface to wind tunnel instrumentation in order to 

make available real-time tunnel data, such as Mach number. 

Several different types of electromagnet power supply are in 

use, presently all on a temporary basis. Some power supplies have 

internal current feedback and their inputs can thus be regarded 

as current demand. The thyratron power supplies in use with the 

main electromagnets have no internal feedback and should thus be 

regarded as having a voltage demand input. 

3.1. POSITION SENSORS 

Model position data is acquired from five linear photodiode 

arrays, each of 1024 elements, illuminated by laser light sheets. 

The general principles of the system are shown in Fig.3.3. and 

Reference 7 gives more details of its operation. The output from 

the processing electronics is in the form of parallel 10-bit 

words, the value of each word corresponding to the number of 

photodiodes illuminated above some threshold level. Presently, 

the 1024th element is ignored. Synchronization of position sensor 

llscanstl with the digital controller is important and is achieved 

in the following way. The (KWV-11C) clock signal which triggers 

the interrupt for initiation of the controller software loop also 

causes a "start scan" trigger to the position sensors. By placing 

the position sensor data input routines immediately after the 

interrupt (at the head of each controller loop), acceptably tight 

synchronization is achieved, with no possibility of erroneous 

data, for all usable position sensor scan times. The hardware 

arrangement is shown in Fig.3.4. and the system timing diagram as 

Fig.3.5. Port assignments for sensor data are shown as Fig.3.6. 

3.2. ISOLATION AMPLIFIERS and ELECTROMAGNET CURRENT MONITORING 

Electromagnet currents are monitored using conventional 

shunts, via a purpose-built isolation amplifier system. Each 

amplifier can be adjusted for gain, offset and first-order filter 

characteristics. Outputs from the current shunt amplifiers are 

monitored by 12-bit A/D converters (ADV-11C). The isolation 

amplifiers are also used as the interface between the PDP 11/23+ 

and the electromagnet power supplies. A complete separation of 

electrical grounds is thereby achieved. This is desirable for 

safety reasons and for the avoidance of earth-loop interference. 

A schematic diagram of the overall arrangement is given as 

Fig.3.7. and isolation amplifier channel assignments are shown as 

Fig. 3.8. 

15 
n 

Lo 

W 

rn 

U 

L 

Q, 

0- 

00 

c 

0 

-- 

.- 

no 

16 
H 

T 

m 

C 

1 

L 

v) 

* -- 

1 

17 
#rays 

wz:: Vertical light fan 

Turning 

mirror 

Bea 

splitter 

Fig.3.3. Schematic diagram of position sensor system 12 channels) 

Position sensor system PDP 11/23+ 

"Start Scan'' 

(To all channels) 

5 * 10 bits 

parallel 

digital data 

(1 * 10 bits per 

c ha n n e I) 

U KWV-11C 

(No.2) 

Interrupt to 

DRV-11J 

Software 

- 

Fig.3.4. Position sensor interface schematic 

la 
KWV-1 1c 

Channel 2 

Position 

Sensors 

MSB 

Channel 1 

PDP-11 

Software 

4 

1- 1/256 sec-i 

MSB MSB Channel 3 Ch. 2 

Interrupt 1 

La Channel 5 

Interrupt 1 

MSB 

Channel 4 

Start scan (n) 1 Start (n+I) 1 

)(, Data from scan (n-1) )(, Data (n) -1 I\ 

Scan time 

< 1/256 sec. 

Fig.3.5. Position sensor software/hardware timing diagram 

15 13 3 0 

10 

5 

Port A 

Port B 

Port c 

Port D 

Fig.3.6. DRV-11J port assignments for position sensor data 

19 
DRV-11 J 

PDP 11/23+ 

ADV-11C 

(2) 

ADV-11 C 

(2) 

Digital data-link r 

Opto-isolators L 

Position 

sensors 

5 (of 8) D/A lines 

Unit 1: Amplifiers 7-12 

ground 

n,, - . 

Power supply I .. - 

ground 

1 9 (of 16) A/D lines &=E* i 1 u I From shunts 

I Pwr_S*2 1 Unit 1: Amplifiers 1-6 

A I 

& Computer & 

analogue and 

digital ground 

Unit 2: Amplifiers 1-12 

Fig.3.7. PDP 11/23, position sensor and isolation amplifier system 

20 
Unit I 

1 

A/D 2.3 

3 5 

A/D 2.5 A/D 2.7 

2 

A/D 2.4 

1 

4 6 

A/D 2.6 A/D 2.8 

l3 

A/D 1.1 

Drag 

A/D 1.2 

Bias 1 

2 

A/D 2.2 

7 

D/A i 

Cntrl 1 

4 

Bias 2 

A/D 1.3 

8 

D/A 2 

Cntrl 2 

5 

Bias 3 

6 

Bias 4 

A/D 1.4 

A/D 1.5 

9 

D/A 3 

Cntrl 3 

10 

D/A 4 

Cntrl 4 

Unit 2 

7 

A/D 1.6 

Cntrl 1 

8 

A/D 1.7 

Cntrl 2 

9 

A/D 1.8 

Cntrl 3 

10 

A/D 2.1 

Cntrl 4 

Amp no. 

Function 

D/A 6 

A/D 2.3 1 

A/D 2.4 * 

A/D channel numbers are Board.Channel 

D/A channel numbers are Channels, across 3 boards 

All A/D amplifiers fed from Power Supply 2 

All D/A amplifiers fed from Power Supply 1 

Fig.3.8. Isolation amplifier channel assignements 

21 
3.3. PDP 11/23+ 

Some relevant details of the hardware and software configuration 

are given below: 

cpu - PDP 11/23 PLUS with FPFll floating point processor 

Operating system - RTll V5.0 

Languages - FORTRAN V2.6, MACRO V5.0 

User 1/0 devices - VT102 CRT, LA100 printer, HP7475 plotter 

Real-time 1/0 - 16/32 A/D channels (differential/single ended) 

12 D/A channels 

64 digital 1/0 lines 

Clocks - 2 programmable 

Serial I/O - 6 lines (console, printer, plotter, 3 spare) 

Memory - 256kB (only 56kB normally available for real-time 

software) 

1/0 module addresses (relevant to digital controller) - 

Module Function Address & Vector (octal) ................................................................ Console CRT serial line 177560 60 

KXT-11C Peripheral processor 160100 

KWV-11C Programmable clock (No.1) 170400 440 

KWV-11c (No.2) 170420 450 

ADV-11C A/D convertors (Board 1) 170430 400 

ADV- 1 1 C (Board 2) 170440 420 

AAV-11C D/A convertors (Board 1) 170450 

AAV-11c (Board 2) 170460 

AAV-11c (Board 3) 170470 

DRV-11J 64-line Digital 1/0 164160 Prog . 

22 
4. CONTROLLER USERS GUIDE 

4.1 HARDWARE OPERATION 

4.1.1 STARTUP 

POWER UP PDP 11/23 AND TERMINALS 

Switch on CRT 

Switch on printer 

Set printer ON LINE 

(Switch at lower left side) 

(Switch at lower left rear) 

(Keyboard key) 

Check HALT switch up on PDP CPU 

Raise PWR switch on PDP CPU 

(Automatic system bootstrap) 

(PWR and RUN lights come on) 

(Bootstrap message on CRT) 

LOAD disc drives 

Wait for READY lights on both 

(Drives 0 and 1) 

LOAD SYSTEM SOFTWARE 

Respond to CRT bootstrap message : 

Type : DL<Ret> 

(System software loads) 

(Startup message appears on CRT) 

(Enter date, eg. 5,24,86) 

RT-11 is now running, as indicated by the DOT prompt. 

(Power up MSBS INTERFACES and POSITION SENSORS if required) 

4 1 2 CLOSEDOWN 

Release disc LOAD switches 

Wait for LOAD lights to come on 

(READY lights extinguish) 

( IMPORTANT) 

Lower PWR switch on PDP CPU 

Switch off CRT and printer 

4.2 CONTROLLER SOFTWARE OPERATION 

4.2.1 ACTIVATE CONTROL PROGRAM 

When all relevant hardware is powered-up, the control 

software can be started, with the MSBS in almost any status 

(model in/out etc.) . 

Type : RUN MSBS<Ret> 

23 
Response: ACCESSING DATA FILES (Controller is reading 

preprogrammed routines, 

zeroizing data stores and 

loading the oscillator 

array) 

Run-Time CRT display appears, showing title 

message, command reminders, etc. 

4.2.2 RUN-TIME SCREEN DISPLAY 

The VT-102 screen display initializes in broadly the 

following format: 

NASA LaRC 13 inch MAGNETIC SUSPENSION and BALANCE SYSTEM .......................... 

IAxial I x I a i r I A I ( 1 Integrators= ( ) 

Drag Int.=( ) 

Outputs=( ) 

ILateral I y I b j s I B I ( 1 

IVerticall z I c k t I C I ( 1 

IPitch I m I e p v I E I ( 1 

I Yaw InlfqwlFl ( 1 Auto routine 

-------------------------- 

<Screen area A> <area B> ’ <area C> 

<Cursor initializes here> 

Screen area A provides Ilmemory joggersv1 for some of the most 

commonly used keyboard command codes. The first column (x-n) 

shows codes for the usual steady position or attitude commands, 

the next three columns show codes for oscillator amplitudes, 

frequencies and phases respectively, with the last column showing 

loop gain codes. 

at the keyboard, with the latest available data. Area B shows the 

measured model position and attitude in each degree of freedom, 

in units of raw counts from the position sensors. This data 

serves mainly as a check when powering up and launching. Area C 

shows the state of various program switches, either ON or OFF and 

the number of the preprogrammed routine presently loaded (see 

Section 2.3). The integrator switches are forced OFF and the 

integrator accumulators are cleared (set to zero) when the output 

switch is OFF. Otherwise the accumulator values are preserved. 

The lower portion of the display scrolls conventionally, 

echoing commands and data entered from the keyboard, or 

displaying real-time data (via the ? command). 

There is typically no external evidence that the controller 

is executing correctly, though a spare D/A channel can be used to 

output a square wave of frequency equal to the loop rate for test 

purposes. Detection of this signal is a reliable indication that 

the software is at least looping correctly (hardware interrupt 

driven). Run-time checks would, however, only normally be 

necessary following major software amendments. 

Screen areas B and C are updated only when <Ret> is entered 

24 
4.2.3 RUN-TIME KEYBOARD COMMANDS 

Communication between operator and system (via CRT/keyboard) 

is handled exclusively by the real-time software, therefore great 

care must be exercised by the operator/programmer. 

Since lower case command codes correspond to the usual runtime commands, the CAPS LOCK key of the CRT should normally be 

released (up). 

................................................................. 

************ TYPING ERRORS ARE LIKELY TO CAUSE ************ ************ LOSS OF CONTROL OF A SUSPENDED MODEL ************ ................................................................. 

Certain controller functions are accessible in real-time 

from the keyboard. In addition, some real-time data may be 

examined via the CRT, though not amended by keyboard input. All 

functions are commanded in a similar format : 

(Number) (-) (CODE LETTER) <Ret> 

Parameters in curved brackets are optional. Note carefully that 

the (optional) minus sign is trailing, the same format being used 

for all screen displays. The function of the CODE letters is 

explained in the following table : 

ESC 033 Abort program 

DEL 177 Delete present input line (line is cleared) 

- 055 Minus sign (must trail value) 

? 077 Query data 

SP 

1 

I1 

# 

$ 

040 

041 

042 

043 

044 

045 

046 

047 

050 

051 

052 

053 

054 

055 

AL position sensor data 

AX 

AU 

FU 

FL 

Unassigned. Reserved for position sensor data 

x position data 

Y 

Z 

L orientation data 

M 

N 

<<Minus sign>> 

25 
/ 

0 

1 

2 

3 

4 

5 

6 

7 

8 

9 

I 

C 

- 

> 

? 

056 

057 

060 

061 

062 

063 

064 

065 

066 

067 

070 

071 

072 

073 

074 

075 

076 

077 

Remaining number of data sweeps 

Reserved for electromagnet 

current data 

II 

II 

II 

II 

II 

II 

II 

It 

Ramp vector 

Ramp increment 

<<Query contents of array location>> 

Upper case codes 

@ 

A 

B 

C 

D 

E 

F 

G 

H 

I 

J 

K 

L 

M 

N 

0 

P 

Q 

R 

S 

T 

U 

V 

W 

X 

Y 

Z 

[ 

\ 

1 

A 

- 

100 

101 

102 

103 

104 

105 

106 

107 

110 

111 

112 

113 

114 

115 

116 

117 

120 

121 

122 

123 

124 

125 

126 

127 

130 

131 

132 

133 

134 

135 

136 

137 

X (axial) loop gain 

Y (lateral) 

Z (vertical) 

L (roll) 

M (pitch) 

N (yaw) Load preprogrammed routine (0-3) 

L Auxiliary displacement 

M 

N 

X Auxiliary displacement 

Y 

Z 

Data acquisition flag (number of sweeps) 

Output flag (O=Off, otherwise On) 

26 
................................................................. Lower case codes 

I 140 

a 141 X oscillator amplitude (Unspecified 

b 142 Y oscillator amplitude units) 

C 143 Z oscillator amplitude 

d 144 L oscillator amplitude 

e 145 M oscillator amplitude 

f 146 N oscillator amplitude 

g 147 Automatic routine flag (number of repeats) 

h 150 Integrator switch (O=off, otherwise on) 

i 151 x oscillator frequency (Units of 

j 152 Y oscillator frequency 0.25 Hz) 

k 153 z oscillator frequency 

1 154 L orientation (Unspecified units) 

m 155 M orientation 

n 156 N orientation 

0 157 L oscillator frequency (Units of 

P 160 M oscillator frequency 0.25 Hz) 

q 161 N oscillator frequency 

r 162 X phase (Units of 360/1024 degrees 

S 163 Y phase in LEAD relative to ref.) 

t 164 Z phase 

U 165 L phase 

V 166 M phase 

w 167 N phase 

X 170 X position (Unspecified units) 

Y 171 Y position 

z 172 Z position 

{ 173 

I 174 

175 

... 176 Master oscillator counter (ticks of 1/256th 

DEL 177 <<Cancel input line>> Also spurious data sink 

second, reset to 0 on 1024th tick) 

Quick reference table for normal runtime (lower case) commands 

] = Outputs on/off h = Main integrators on/off 

H = Drag integrator on/off [ = Data acquisition (no. sweeps) 

g = Auto routine (no.repeats) DEL = delete input (line clears) 

ESC = abort program 

27 
Other functions 

Examples 

3000A <Ret> - sets axial (drag) gain to 3000 

1000-m <Ret> - calls for small negative pitch 

displacement 

20[ <Ret> - takes burst of 20 data sweeps 

h <Ret> - turns off integrators 

- causes display of last Z (heave) 

model position sample 

Note that ?, DEL or ESC do not require the usual <Ret> terminator 

4.2.4 Launch and landing sequences 

Launch 

With control software activated and most MSBS systems 

powered-up (NOT ggCONTROLgg orttBIASgt orttDRAGgg supplies) a 

sequence of operations to launch the model might be: 

1) Activate BIAS supplies and set to desired current 

2) Activate CONTROL currents and DRAG current. No significant 

currents should flow in any controlled coil. 

3) Type 50002 <Ret> (commands system to suspend model very low, 

roughly corresponding to its position on 

the model launcher) 

4) Type 13 <Ret> (turns outputs ON, small control currents 

begin to flow, model is now under partial 

control) 

4) Type 2 <Ret> (commands model to lift to datum position. 

Offset settings in the program usually 

result in insufficient current to actually 

lift the model) 

5) Type lh <Ret> (turns position error integrators ON. Model 

1H <Ret> will now rise positively to the desired 

position and orientation) 

28 
Landinq 

1) Type 1 <Ret> (turns output currents OFF, model drops onto 

grabbers, integrators turn OFF) 

2) Turn off CONTROL and DRAG power supplies 

3) Turn off BIAS currents 

4) Abort control program (llESC1f) 

4.3 LIMITATIONS and RESTRICTIONS 

Data acquisition 

The limited direct memory addressing capability of PDP-11 

computers (32kW (kwords)), together with the overhead of the 1/0 

page (4kW), the vector table (320W) and RT-11 (varies between 2kW 

and 5KW depending on monitor type and configuration), leaves 

rather restricted memory available for real-time data. In fact 

the overlayed structure of the controller program (Section 2.2) 

is employed solely to free as much memory as possible. 

Nevertheless, only around 12000 words of real-time data storage 

can normally be made available, corresponding to 12000 data 

samples. With a number of samples being taken per program loop 

(typically at least 14 samples = 5 positions/attitudes + 9 

currents), the maximum number of data llsweepsll is given by : 

S = 12000/14 = 857 (approx) 

At 256 program cycles per second, this is in turn equivalent 

to less than 3.3 seconds of real-time data. Data can be taken in 

several bursts at any interval up to the maximum number of sweeps 

shown above. Data overflow is prevented by repetitively 

overwriting, when necessary, the last set of valid data 

locations. Otherwise the program would attempt to write to 

sequential memory locations beyond the data array, eventually 

corrupting other program code. 

The short-term solution to the memory problem is seen as 

invoking RT-11 Memory Management instructions to access Extended 

Memory in real-time. On a PDP 11/23 up to around 2000kW of such 

memory may be installed. The coding necessary to implement access 

is certainly feasible, but by no means trivial. 

Control Alaorithms 

Existing control algorithms are rather unsophisticated and 

are long overdue for replacement. 

Prefilter and translator 

As presently structured, these modules can implement a fixed 

linear relationship between input and output, eg.: 

29 
(Axial position) (a b c d e) (AL) 

(Pitch attitude) ( etc. ) (FU) 

( Lateral pos.) (f g . 1 (AX) 

( Vertical pos.) = ( 1 (AU) 

( Yaw attitude) ( 1 (FL) 

- (Prefilter) 

and: 

(E/M 1 demand) (1 m n o p) (Vertical demand) 

(E/M 2 demand) (q r . ) (Pitch demand ) 

(E/M 3 demand) = ( ) (Lateral demand ) -(Translator) 

(EjM 5 demandj ( ) (Axial demand ) 

(E/M 4 demand) ( ) (Yaw demand 1 

The 13" MSBS is inherently non-linear. For instance, the 

vertical magnetic force, below the point of saturation of the 

model's core, will vary as the square of the Wertical'l current 

(a sum of currents in the four main E/Ms). If this peculiarity is 

to be accomodated, much more elaborate translator coding will be 

necessary. The present coding might be regarded as a piecewise 

linear approximation, valid for small perturbations about the 

selected datum position/orientation and force/moment level. The 

effects of variations in the force/moment level, such as between 

wind-on and wind-off test points, can be partially accomodated by 

re-trimming loop gains (from the operator's keyboard). This is, 

in fact, a technique that was used extensively by MIT with their 

611 MSBS for somewhat similar reasons. 

attitudes is contemplated, then the inevitable variation of 

translator coefficients (particularly with attitude) due to the 

nature and behaviour of the magnetic field gradients will have to 

be taken into consideration. This issue is very complex (see 

Ref. 6) . 

Similarly, the variation of prefilter coefficients with 

model position and/or attitude (particularly attitude) would need 

to be taken into consideration for large excursions from the 

datum to be possible. Analysis is relatively more straightforward 

here however, being dependant exclusively on system geometry. 

If suspension over a wide range of positions and/or 

30 
APPENDIX A 

COMPILATION, ASSEMBLY AND LINKING OF EXECUTABLE PROGRAM 

A total of 44 files are involved in the creation of the 

executable program; 10 source code files, 12 command files, 2 

library files, 8 object modules, 9 listing or map files, 2 runtime datafiles and finally the executable program file itself. 

illustrates the complete procedure for creation of the executable 

program. Refer to the source code listings in Appendix B. 

Table A.l lists all the file names and functions. Table A.2 

TABLE A.l FILENAMES AND FUNCTIONS 

FILENAME FUNCTION and COMMENTS 

Source code files : 

MSBS. FOR FORTRAN root 

DATIN. FOR Data input/load Calls MSBS.DAT at run-time 

DATOUT.FOR Data output/store Creates DATA.DAT at run-time 

TTON . MAC Initialize (display) Requires CONFIG.MLB 

TTOFF. MAC De-initialize I1 

START. MAC Startup module II 

USERIO. MAC User 1/0 module II 

CNTROL. MAC Controller module - and CNTRLB.MLB 

CONFIG.MAC Configuration library source 

CNTRLB . MAC Real-time 1/0 library source 

Command files : 

MSBS. COM Command file for MSBS.FOR compilation 

DATIN. COM -for compilation of DATIN.FOR 

DATOUT.COM -for compilation of DATOUT.FOR 

TTON . COM -for assembly of TTON.MAC 

TTOFF . COM -for assembly of TTOFF.MAC 

START. COM -for assembly of START.MAC 

USERIO.COM -for assembly of USERIO.MAC 

CNTROL.COM -for assembly of CNTROL.MAC 

MSLINK. COM -for linking of MSBS.SAV 

................................................................. 

................................................................. 

................................................................. 

................................................................. 

................................................................. 

................................................................. 

MSDBG. COM -expanded functions of CNTROL.COM for debugging 

CNTRLB.COM Command file to create CNTRLB.MLB library 

CONFIG.COM -to create CONFIG.MLB library ................................................................. 

Numerous temporary or auxiliary files are created during the 

compilation, assembly and linking processes : ~~ 

CONFIG.MLB MACRO library modules 

CNTRLB.MLB 

31 
I 

I MSBS . OBJ 

DATIN. OBJ 

DATOUT. OBJ 

TTON . OBJ 

TTOFF. OBJ 

START. OBJ 

USERIO.OBJ 

CNTROL. OBJ 

~__ 

Object modules 

MSBS . LST 

DATI??. LST 

DATOUT. LST 

TTON. LST 

TTOFF. LST 

START. LST 

USERIO. LST 

CNTROL. LST 

MSBS .MAP 

Compiler listing files 

Assembler listing files 

Linker map file 

2 run-time datafiles are required or created : 

MSBS . DAT Preprogrammed model motions (required) 

DATA. DAT Acquired real-time data (created/overwritten) ................................................................. 

The final executable program file is : 

MSBS . SAV Executable program, calls MSBS.DAT, creates 

................................................................. 

DATA.DAT at run-time. 

TABLE A.2 MODULE COMPILATION, ASSEMBLY and LINKING 

Command files are activated under RT-11 by entering: 

@FILNAM <Ret> -where .COM is the default extender 

ASSEMBLE MACRO MODULES 

Command file Input modules Output modules 

TTON (.COM) TTON.MAC, CONFIG.MLB TTON. OBJ, TTON. LST 

TTOFF (.COM) TTOFF.MAC, CONFIG.MLB TTOFF . OBJ , TTOFF LST 

................................................................. 

32 
START (.COM) START.MAC, CONFIG.MLB START.OBJ, START.LST 

USERIO ( . COM) USERIO.MAC, CONFIG.MLB USERIO.OBJ, USERIO.LST 

CNTROL (.COM) CNTROL.MAC, CNTRLB.MLB, CNTROL.OBJ, CNTROL.LST 

CONFIG.MLB ................................................................. 

MSDBG (.COM) CNTROL . MAC, CNTRLB . MAC, CNTROL. OBJ , CNTROL. LST 

CONFIG .MLB 

(MSDBG includes full MACRO expansions) ................................................................. 

COMPILE FORTRAN MODULES 

Command file Input modules Output modules 

MSBS ( .COM) MSBS .FOR MSBS.OBJ, MSBS.LST 

DATIN (.COM) DATIN. FOR DATIN . OBJ , DATIN. LST 

DATOUT ( .COM) DATOUT.FOR DATOUT.OBJ, DATOUT.LST 

................................................................. 

................................................................. 

LINK OBJECT MODULES 

Each command file (compilation, assembly or linking process) 

should be activated only when an input module to that file 

(process) is modified. For example, if CNTRLB.MAC is altered 

(edited), the procedure to generate a revised executable program 

would be : 

@CNTRLB <Ret> -generate revised library 

@CNTROL <Ret> -reassemble modules that 

utilize CNTRLB routines 

@MSLINK <Ret> -relink executable program 

33 
APPENDIX B 

SOURCE CODE LISTINGS 

MSBS. COM 

DATIN. COM 

DATOUT.COM 

TTON . COM 

FORT/ LIST : MSBS/WARN MSBS 

FORT/LIST:DATIN/WARN DATIN 

FORT/LIST:DATOUT/WARN DATOUT 

R MACRO 

TTON,TTON=CONFIG/M,TTON 

"C 

TTOFF . COM 

R MACRO 

TTOFF,TTOFF=CONFIG/M,TTOFF 

"C 

START. COM 

R MACRO 

START,START=CONFIG/M,CNTRLB/M,START 

"C 

USERIO.COM 

R MACRO 

USERIO,USERIO=CONFIG/M,USERIO 

"C 

CNTROL. COM 

R MACRO 

CNTROL,CNTROL=CONFIG/M,CNTRLB/M,CNTROL 

"C 

MSLINK. COM 

R LINK 

MSBS,MSBS=MSBS/C 

DATIN,TTON/O: 1/C 

DATOUT,TTOFF/O: 1/C 

START,USERIO,CNTROL/O:l 

MSDBG.COM 

R MACRO 

CNTROL,CNTROL/L:ME=CONFIG/M,CNTRLB/M,CNTROL 

CONFIG.COM 

CNTRLB.COM 

"C 

LIBRARY/MACRO 

LIBRARY/MACRO 

CONFIG CONFIG 

CNTRLB CNTRLB 

34 
MSBS . FOR 

DIMENSION 1SC1LL(1024),1C0MM(960),1DATA(1202020~,1C~S~96) 

C 

C FETCH DISC DATAFILES, FILL ARRAYS, INITIALIZE W100 

C 

CALL DATIN( ISCILL,ICOMM,IDATA,ICHARS) 

C 

C CALL MAIN CONTROL PROGRAM 

C 

CALL START(ISCIU,ICOMM,IDATA,ICHARS) 

C 

C RESGT W100, STORE DATAFILES IF IEQD. 

C 

C 

C FINISHm 

C 

CALL DATOUT(1DATA) 

STOP 

END 

35 
DATIN. FOR 

SUBROUTINE DATIN(ISCILL,ICOMH,IDATA,ICHARS) 

DIMENSION ISCILL~1024~,ICOMM~96O~,IDATA~1202~~,~~~S~S6~ 

DIMENSION IDUM( 40 1 

LOGICAL*l ICHAR 

C 

C READ IN PREPROCRAMMED ROUTINE 

C 

10 FORMAT(' ACCESSING DATA FILES') 

TYPE 10 

OPEN(UNIT=1,NAMEr'HSBS.DAT',TYPEn'OT.D'~F~RM='FoR-~-~'~ 

lRECORDSIZE=61) 

DO 15 1=1,960 

DO 35 I=1,100,3 

15 ICOMM( I) =o 

20 READ(1,30,END=38) ICOMM(I),ICOMM(I+1),ICHAR,(IDUn(J),J~l,40~ 

30 FORMAT(218,2X,A1,2X,40A2) 

C 

C CONVERT LETIERS TO ARRAY ADDRESS 

C 

35 ICOMM(I+2)=((IcHAR-32)*2) 

38 CLOSE(UNIT=l) 

C 

C END OF READ IN. CALCULATE SINE WAVE 

C 

PI-3,141592654 

DO 40 1=1,1024 

X=PI*FLOAT(I-1)/512.0 

40 ISCILL(I)=INT(32767.*SIN(X)) 

C 

C ZEROISE DATA STORAGE 

C 

50 IDATA(I)=O 

51 ICHARS( I) =o 

C 

C SET UP SYSTEM LOOP GAINS 

C 

DO 50 1=1,12020 

DO 51 I=1,96 

ICHARS(34)=12000 IAXIAL GAIN 

ICHARS( 35 1 =7500 ILATERAL GAIN 

ICHARS( 36 )=7500 IVERTICAL GAIN 

ICHARS( 38 1 =3500 IPITCH GAIN 

ICHARS( 39 1 =3500 

ICHARS( 16) =850 IMAX. NUMBER OF DATA SWEEPS 

IYAW GAIN 

C 

C CALL VT100 INITIALIZING ROUTINE 

C 

C 

C DONE HEXE 

C 

CALL TTON 

RJCTUIN 

END 

36 
DATOUT.FOR 

SUBROUTINE RATOUT(1DATA) 

DIHENSION IDATA(12020) 

C 

C CALL VI100 RESET ROUTINE 

C 

CALL TTOFF 

C 

C .SAVE DATA? 

C 

TYPE 70 

70 FORHAT(' CONTROLLEZ? ABORTED. DATA TO FILES? (l=!lES, 0-NO)') 

READ(5.21) NSAVE 

IF(NSAVE.NE.1) GO TO 80 

C 

C OUTPUT SOME DATA 

C 

90 FORHAT(' DATA BEING STORED') 

TYPE 90 

OPEN(UNIT=2.NAME='DATATA.DAT',TPPEI"EW',FO~='~O~~', 

Do 100 1=1,12000 

lRECORDSIZE=l) 

100 WRITE (2) IDATA(1) 

C 

80 COrnINUE 

CLOSE(UNIT=2) 

RmmN 

END 

37 
TTON . MAC 

.TITLE TTON ;PROGRAH TITLE 

; 

.............................................................................. 

; Purpose: !ITON peforms some system initialization and sets up the VT-I02 

; 

; Environment: Executes once only 

i 

; Related modules: Called from and returns to DATIN 

i 

; Data 1/01 None 

; 

; Variables: None .---------------------------------------------------------------

i 

i 

;FETCH 110 DEVICE ADDRESSES 

8 

; 

;TURN OFF SOME SYSTEM INTERRUPTS 

i 

TTON:: BIC 9100 .wms ;INHIBIT KEYBOARD INTERRUPTS 

; 

;SETUP F'LOATING POINT PROCESSOR 

i 

.WALL CONFIG ;CONFIGURATION MACRO 

CONF'IG ;SYSTpJ CONFIGURATION AND DEFINITIONS 

MOV #O , (O#LCLx ;DISABLE LINE CLOCK INTESRUPTS 

SET1 ;SET SHORT INTEZESS 

SEXF ;SET SINGLE PRECISION FLOATING MODE 

i 

;SETUP DIGITAL 110 PORTS 

i 

CLR BICCSRA ;PORT A STATUS REGISTER 

CLR WCSRB ;PORT B 

CLR WCSRC . ;PORT c 

CLR WCSRD ;PORT D 

; 

;DISPLAY ROUTINE - Set up initial VT-102 screen display. Uses XON/XOFT' 

i protocol to control rate of character output 

i 

MOV #BUFF1 ,RO ;FETCH ADDRESS OF OUTPUT STRING 

FETCH: HOVE (RO)+,Rl ;FETCH NEXT CHhRACTER 

BE0 

TEST: TSTB WTPS 

BPL TEST ;WAIT IF NOT 

MOVE Rl,@#TPB ;OUTPUT CHARAm 

TSTB WTKS ;HAS CRT SENT A CHARACER? 

BPL m ;CONTINUE (IGNORE IT) IF NOT 

MOVB (P#TKB,R2 ;FETCH CHARACTER IF AVAILABLE 

CWB #23,R2 219 THIS AN XOFF? 

BNE FE;TcH ;CONTINUE IF NOT 

BPL XON ;WAIT FOR ONE IF NOT 

DONE ;JUMP OUT IF TERMINATOR (ASCII NULL) 

;IS PRIN!EB INTEWACE READY? 

XON : TSTB (P#TKS ;HAS CRT SENT AN XON? 

MOVB @#TKB,R2 

CMPB #21,R2 

BNE XON 

;mal cHARAm 

;HAKE SURE IT IS AN XON 

;KEEP WAITING IF NOT 

BR FETCH ;RESW OUTPUT IF IT WAS XON 

I 

WNEr RTB PC 

i 

;BUFF1 description: 

;RETURN TO CALLING MODULE 
;Line 1: 

;Lines 2-3: 

;Line 4: 

;Lines 5-16: 

;Lines 17-19: 

;Line 20: 

;Line 21: 

;Line 22: 

h"l: .ASCII 

.ASCII 

.ASCII 

.ASCII 

.ASCII 

.ASCI I 

.ASCII 

.ASCII 

.ASCII 

.ASCII 

.ASCII 

.ASCI I 

.ASCII 

. ASCI I 

.ASCII 

.ASCI I 

.ASCII 

.ASCII 

.ASCII 

.ASCII 

.ASCII 

.ASCII 

Set scrolling area (lines 11-24), move cursor to toplleft home 

Title in reverse video 

Define alternate character set (accessed by SI/SO) 

Memory jogger block 

Switch display block 

Auto routine display block 

Move cursor to top of scrolling area 

String terminator 

<33)/C11;24r/<33)/C2J/<33)/CH/<33) 

/C7m NASA Langley Research Center 13 inch MAGmIC I 

ISUSPmSION and BALANCE SYSTEM /<33)/Cm/ 

<33)/10/<33)/(B/ 

<33)/C3;1H/<16)/lqqqqqqqqqqwqqqwqqqqqqqq~qqk/<l7~<15~<12~ 

<16)/x/<17)/ Axial /<16)/x/<17)/ x /<16)/x/<17)/ a i r / 

<16)/x/<17)/ A /<16)/~/<17)<15)<12) 

<16)/x/<17)/ Lateral /<16)/x/<17)/ y /<16)/x/<17)/ b j 8 / 

<16>/x/<17)/ B /<16)/~/<17)<15)<12) 

<16)/r/<17)/ Vertical /<16)/x/<17)/ z /<16)/x/<17)/ c k t 1 

<16)/x/<17)/ C /<16)/~/<17)<15)<12) 

<16)/x/<17)/ Pitch /<16)/x/<17)/ m /<16)/x/<17)/ e p v / 

<16)/x/<17)/ E /<16)/x/<17)<15)<12) 

<16)/x/<17)/ Yaw /<16)/x/<17)/ n /<16)/x/<17)/ f q w / 

<16>/x/<17)/ F /<16)/x/(17)<15)<12> 

<33>/C4;45HIntegrators=/ 

<33>/C5;47HDrag Int.=/ 

<33)/C6;49HOutputs=/ 

<33)/C8;45HAuto routine/ 

<33)/Cll;lH/ 

(0) 

(16) /mqqqqqqqqqqvqqqvqqqqqqqvqqqj 1 (17) 

i 

.END 

39 
TTOFF .MAC 

.TITLE T!l?OF’F ;PROGRAM TITLE 

i 

............................................................................... 

; Purpose: 

i 

; Environment: Executes once only 

i 

2 Related modules: Called from and returns to DATOUT 

0 

; Data 1/01 None 

i 

2 Variabies: None 

;““’--”“““““””””””””””-------------------------------~---

8 

2 

2 

8 

;DISPLAY ROUTINE - Rpsets VT-302 screen display. Uses XON/XOE’F protocol 

2 

TM)FFr : MOV QBUFF~ .RO zFGllCH ADDRESS OF OUTPUT STRING 

F”: MOVB (RO)+.Rl ;FETCH NE3cT CHARATEST: TSTB WTPS 

TTOFF performs some rrystem and all VT-102 deinitialization 

.MCALL CONFIG ;CONFIGURATION MACRO 

;m I/O DEVICE ADDRESSES 

CONFIG ;SYSTEM CONFIGURATION AND DWINITIONS 

DONE ;JUMP OUT IF TERnINATOR (ASCII NULL) 

;IS PRINTER INTERFACE READY? BEQ 

BPL TEST ;WIT IF NOT 

MOVE Rl,(P#TPB ;OUTPUT CHARACTER 

TSTB @#TKS iHAS CRT SENT A CHARACl?ER? 

BPL FETCH ;CONTINUE IF NOT 

MOVE @#TKB,R2 ;FETCH CHARACTER IF AVAILABLE 

CHPB #23,~2 ;IS THIS AN XOFF? 

BNE FETCH rCONTINUE IF NOT 

BPL XON ;WAIT FOR ONE IF NOT 

MOVB B#TKB.R2 ;FETCH CHARACTER 

CHPB 4421.~2 ;MAKE SURE IT IS AN XON 

BNE XON ;KEEP WAITING IF NOT 

BR FETCH ;RESUME OUTPUT IF IT WAS XON 

XON : TSTB WTKS ;HAS CRT SENT AN XON? 

i 

;RESTORE SOME SYSTPI IN!CE3RUP!B 

i 

DONE: BIS 9100 ,cpms 

BIS #lOO,cp#LCLK 

RTS PC 

i 

2 

BUFFlr .ASCII <33)/Clr24r/ 

.ASCII (33)/C24#1H/ 

.ASCII (0) 

.END 

i 

40 

iRESTORE KEYBOARD IwTERRueTS 

;RESTART LINE CLOCK 

;Set whole screen scrolling 

;Cursor to bottom line 

;String terminator 
USERIO. MAC 

.TITLE USER10 ;PROGRAM TITLE 

; 

.............................................................................. 

I Purpose: 

; 

; Environment: Executes continuously, unless interrupted by hardware. No CRT 

; handshaking employed, the rate of character output assumed to 

; be slowed by repeated interruption of execution 

; 

; Related modules: 

i 

i 

; Data 110: 

USERIO handles all real-time keyboard input and CRT output 

System hardware interrupts are initialized by START, 

CNTROL executes once per hardware interrupt 

All I10 takes place via the command array CHARS 

Var iables: CHARS array specified seperately. MASK is used to block 

certain illegal repeated inputs, only Bits 0-2 used: 

Bit 0 - Numeric value received from keyboard (O=No, l=Yes) 

1 - Implicit or explicit sign received 

2 - Code letter received .---------------------------------------------------------

; 

; 

.GLOBL CHARS,COMMAN ;DATA AND COMMAND ARRAYS 

.MCUL CONFIG ;REQUIRED MACROS 

; 

;FETCH SYSTEM CONFIGURATION 

; 

; 

;INPUT CHARACTER FROM KEYBOARD AND VECTOR TO ROUTINES 

CONFIG ;SYSTp1 CONFIGURATION AND DEFINITIONS 

* 

USERIO: : JSR 

CMP 

CMP 

BMI 

CMP 

BEQ 

CtiP 

EM1 

CMP 

BNI 

CMP 

BEQ 

CMP 

BE0 

CMP 

BNE 

ESCAPE: RTS 

;DELETE - Clear 

DELEllE: MOV 

JSR 

CLR 

MOV 

CLR 

JMP 

; 

; 

PC ,m 

#177 ,RO 

DELEXE 

#lo0 ,RO 

LElTER 

#77,RO 

QUERY 

#71 ,RO 

USER10 

#57 ,RO 

NUMBER 

#55 ,RO 

MINUS 

#15,RO 

REmJRN 

#33 ,RO 

USER10 

PC 

screen input 

#OUT11 ,R2 

PC , OUTSTR 

KEYNUM 

#177 ,KEYLET 

MASK 

USER10 

;FETCH INPUT CHARACTER 

;DELETE? 

;GO TO DEL= HANDLER IF DELETE 

; LETTER? 

;GO TO LETIZR HANDLER IF LEZTER 

;QUERY? 

;GO TO QUERY HANDLES IF QUERY 

;LOOK FOR SOME ILLEGAL CHARACTERS 

;GO BACK IF ILEAL 

;NUMBER? 

;GO TO NUMBER HANDLER IF "BER 

:MINUS? . ._ -. - - 

;GO TO MINUS HANDLER IF MINUS 

;CARRIAGE RE"? 

;GO TO CARRIAGE RETURN HANDLER 

;ESCAPE? 

;GO BACK SINCE ALL HERE ARE ILLEGAL 

; (EXCEPT ESCAPE) REX" TO START MACRO 

line and data 

;F" ADDRESS OF LINE BLANKER 

;DO IT 

;ZEROISE KEYBOARD INPUT 

;KEYBOARD LElTER STARTS AS DELETE 

;CLEAR INPUT MASK 

;BACK TO START 

;LETTER HANDLER - Store legal letter code 

; 

41 
LEZTER: BIT #4 ,MASK ;ONLY ONE LEITER ALLOPED 

BNE 

_. ~ USER10 :OTHERWISE BACK TO START 

BIS Y77MASK ;a HAVE LGIITER, BLOCK NUMEER/SIGN 

JSR PC , PRINSC ;mo CHARACTER 

SUB #40 ,RO ;CONVERT TO ARRAY OFFSET 

ASL RO ;CONVERT TO WORD ADDRESSING 

nov RO .KEXLET ;STORE LEIlXR CODE 

JMP USER10 ;JUMP BACK TO START 

3 

;MINUS - Negate present input value 

i 

"US: BIT 66 ,WK ;CHECK IF ACCEPTABLE 

BNE USER10 ;JUMP OUT IF NOT 

JSR PC ,PRINSC ;ECHO CHARACTER 

NEE KEYNUM KEYBOARD INPUT 

BIS #2 ,WK ;ME HAVE A SIGN 

JMP USER10 ;wm HERE 

i 

;NUMBER - Multiply up present input value 

t 

NUEIBER: BIT 

BNE 

BIS 

JSR 

SUB 

MOV 

MIL 

ADD 

MOV 

JMP 

i 

;QmY ROUTINE 

3 

QUERY: BIT 

BNE 

JSR 

GET2 ; JSR 

CMP 

BE0 

CMP 

BPL 

JSR 

SUB 

ASL 

MOV 

JSR ' JSR 

JMP 

#6 , MASK 

USER10 

#l ,MASK 

PC ,PRINSC 

#60 .RO 

KEXNUM , R1 

#lo. ,R1 

RO ,R1 

R1 ,KEyNUM 

USER10 

- Input letter 

87 .MASK 

USER10 

PC , PRINSC 

PC , FETCH 

X33,RO 

ESCAPE 

#37 ,RO 

GET2 

PC , PRINSC 

#40 ,RO 

RO 

CHARS(RO), 

PC , DECOUT 

PC .cARRLF 

USER10 

RO 

;CHECK IF ACCEPTABLE 

;JUMP OUT IF NOT 

;WE HAVE NUMBER 

;ECHO CHARACTER 

;CONVERT RO TO ACTUAL NUMBERS 

;FETCH PRESENT INPUT VALUE ACCUMULATOR 

;INCREMENT EXPONENT 

;ADD IN PRESENT DIGIT 

;RESTORE KEYNUM 

;GO BACK TO START 

code to query then output relevant value to CRT 

;ACCEPT ONLY IF FIRST CHARACTETI 

;OTHERWISE BACK TO START 

;ECHO CHARACE3 

;GFT ANOTHER INPUT CHARACTER 

;ESCAPE? 

;GO TO ESCAPE HANDLER IF YES 

;LOOK FOR ILLMZAL CODE 

;JUMP OUT IF ILLEGAL 

;ECHO LEGAL CHARACTER 

;CONVERT TO ARRAY OFFSEZ! 

;CONVERT TO WORD ADDRESSING 

;FETCH QUERIED VALUE 

;PUSH OUT DECIMAL VALUE 

;OUTPUT CR/LF 

;BACK TO START 

r 

rCARRIAGE RETURN - Output CR/LF, then enter Screen Update section 

t 

RJZKJFNr MOV KEYLEI:, R 0 ;FETCH LGlTER CODE 

MOV K.EYNUM.CWS(RO);LOAD KEYBOARD INPUT TO CHARS mY 

JSR PC , CARRLF ;OUTPUT CR/LF 

CLR KEYNUM ;ZEROISE KEYBOARD INPUT 

MOV #177,KEyLGT ;KEYBOARD LETIT34 STARTS AS DELETE 

CLR MASK ;CLEAR INPUT MASK 

i 

;SCREEN UPDA!t'E - Save cursor position before starting work on displays 

3 

MOV #OUT1 , R2 ;FETCH ADDRESS OF CURSOR SAVE 

42 
JSR PC , OUTSTR ;DO IT 

i 

;UPDATE POSITION DISPLAY - Pseudo real-time position sample display area 

i 

CRSMOV: MOV #OUT2 ,R2 ;FETCH ADDFESS OF CURSOR MOVE C0"D 

JSR PC , OUTSTR ;DO IT 

MOVE OUT3,Rl ;F" CURSOR LINE NUMBER (START AT 4) 

SUB #60 ,R1 ;CONVERT TO ACTUAL NUMBERS 

CMPB #6,R1 ;ABOVE 6? (TRYING TO SKIP ROLL DATA) 

BPL DISPLC ;JUMP AROUND IF NOT 

INC R1 ;SKIP 1 ARRAY ELEMENT FOR ROLL 

DISPLCI ASL R1 ;CONVERT TO WORD ADDRESSING 

ADD #4 ,R1 ;CONVERT TO ARRAY OFFSGT 

MOV CHARS(R11,RO ;RO CONTAINS ARRAY VALUE TO OUTPUT 

JSR PC , DECOUT ;OUTPUT ARRAY VALUE 

MOV #OUT5 ,R2 ;ETCH ADDRESS OF DUMMY SPACES 

JSR PC , OUTSTR ;PUSH OUT SPACES (TO MASK OLD "BERS) 

INCB OUT3 ;INCREMENT LINE NUMBER COUNTER 

CMPB #7O,OUT3 ;IS IT PAST LAST LINE? (END AT 8) 

BPL CRSMOV ;LOOP BACK IF NOT 

LAS!CLN: MOVB #64,0UT3 ;REsm LINE NUMBER COUNTER (ASCII 4) 

i 

;SWITCH DISPLAY UPDATE - Program switch display area 

i 

MOV #OUT6 ,R2 ;MOVE TO MAIN INTEGRATOR UPDATE 

JSR PC , OUTSTR ;DO IT 

MOV INTFLG,RO ;ARE MAIN INTEZRATORS ON? 

JSR PC , ONOFF ;OUTPUT ONIOFF MESSAGE 

MOV #OUT9 ,R2 ;HOW TO DRAG INTEGRATOR UPDATE 

JSR PC , OUTSTR ;DO IT 

MOV DRGFLG , RO ;IS DRAG INTEERATOR ON? 

JSR PC , ONOFF ;OUTPUT ON/OFF MESSAGE 

MOV #OUT10 ,R2 ;MOVE TO OUTPUT UPDATE 

JSR PC , OUTSTR ;DO IT 

MOV OUTFLG ,RO ;ARE OUTPUTS ON? 

JSR PC , ONOFF ;OUTPUT ON/OFE' MESSAGE 

i 

;LOAD CORRECT AUTO ROUTINE and DISPLAY 

i 

TST AUTFLG ;IS A ROUTINE ALREADY RUNNING? 

BNE RSTORE ;IGNORE POSSIBLE REQUEST IF YES 

MOV AUT",Rl ;FETCH AUTO ROUTINE NUMBER 

BIC #177774,Rl ;TRUNCATE ROUTINE NUMBm TO 0-3 

MOV R1 ,AUTNUM ;UPDATE ROUTINE NUMBER 

MTL 8480. ,R1 ;CONVERT TO BYTE ADDRESSING 

ADD COMMAN+4 ,Rl ;ADD ADDRESS OFFSET 

MOV R1 ,C0)4"+2 ;UPDATE 1ST ARCHIVE POINTER 

MOV R1, COMMAN ;UPDATE RUN-TIME POINTER 

MOV #OUT12 ,R2 ;MOVE TO AUTO ROUTINE "BER 

JSR PC , OUTSTI? ;DO IT 

MOV AUTNUM,RO ;€'ETCH AUTO ROUTINE NUMBER AGAIN 

JSR PC , DKOUT ;OUTPUT ROUTINE NUMBER 

i 

RSTORE: MOV #OUT4 ,R2 ;FETCH ADDRESS OF CURSOR RESTORE COMMAND 

DONE: JMP USER10 . ;GO BACK TO START 

i 

;SUBROUTINES - OUTSTR, DECOUT, ONOFF, FETCH, CARRLF', PRINSC 

i 

rSUBROUTINE OUTSTR - Send stored ASCII Btrinq to CRT 

JSR PC , OUTSTR ;DO IT 

43 
OUTSTR: HOVB (R2)+,RO ;F" FIRST CHARACTER 

TEST2: TSTB @#TPS 

ENDSTR ;JUMP OUT IF TERMINATOR 

$IS CRT READY? 

BEQ 

BPL TEST2 $WAIT IF NOT 

HOVB RO,(P#TPB #OUTPUT CHARACTER 

BR OUTSTR ;LOOP BACK FOR NEXT CHARACXEX4 

ENDSTR: RTS PC ;RETURN FROM SUBROUTINE 

; 

;SUBROUTINE DECOUT - Decode value in NUMBlJ'F and send to CWT as ASCII numbers 

&!OUT: MOV NUMBUF',R2 ;GET ADDRESS OF NUMBER STORE 

TST RG ;IS Ti VAL-UE NEZATIVE? 

BPL DIVIDE ;JUMP IF NOT 

NM; RO ;CHANGE SIGN TO POSITIVE FOR OUTPWI! 

MOVB #55, (R2)+ ;PUSH MINUS INTO NUMBER STORE 

CLR RO ;CLEAR HIGH HALF OF DIVIDDIV #lo. .RO ;DIVIDE BY 10, REMAINDER IN R1 

ADD 060 ,R1 ;CONVERT TO ASCII 

MOVE Rl,(R2)+ ;STORE CHARACTER AS OCTAL BYTE 

TST RO ;ARE HE DOWN TO ZERO YGT? 

BNE DIVIDE ;LOOP BACK IF ANY MORE DIGITS TO COME 

MOVB #40, (R2)+ ;PUSH SPACE INTO NUMBER STORE 

BPL NUMOUT ;HAIT IF NOT 

MOVB - (R2 1 ,WTPB ;OUTPUT cHARAm 

CMP NUMBUF ,R2 ;ARE HE DONE? 

BNE NUMOUT ;LOOP BACK IF NOT 

RTS PC ;REI" FROM SUBROUTINE 

DIVIDE: MOV RO ,R1 ;PUSH VALUE DOWN TO LOW HALF OF DIVIDEND 

NUMOUT: TSTB @#TPS ;IS CRT READY? 

; 

;SUBROUTINE ONOFF - Send ASCII "ON" or "OFF" to CRT depending on value in RO 

3 

ONOFF: TST RO ;SWITCH ON OR OFF? (O=OFF, OTHERS ON) 

ON : MOV tOUT7, R2 ;FETCH ADDFESS OF OFF MESSAGE 

OFF$ MOV #OUT8, R2 ;FETCH ADDRESS OF ON MESSAGE 

=J) OFF ;GO TO OFF MESSAGE 

JSR PC , OUTSTR ;DO IT 

RTS PC ;DONE HERE 

JSR PC , OUTSTk ;DO IT 

RTS PC ;DONE HERE TOO 

; 

ISUBROUTINE F" - Input single character from keyboard, wait if none ready 

; 

FE;TCH: TSTB @#TKS ;IS CHARACTER READY? 

BPL FETCH ;WAIT IF NOT 

MOVB @WTKB,RO ;FFTCH INPUT CHARACTER 

RT3 PC ;REX" FROM SUBROUTINE 

; 

;SUBROUTINE CARRLF - Send CR/LF combination to CRT 

8 

CARRLFr TSTB WTPS ;IS CRT READY? 

BPL CARRLF ;WIT IF NOT 

MOVB $15, @#TPB ;OUTPUT CR 

BPL TEST ;WIT IF NOT 

MOVB #12,B#TPB ;OUTPUT LF 

RT3 PC ;REXURN FROM SUBROUTINE 

TEST: TSTB WTPS ;IS CRT READY? 

; 

;SUBROUTINE PRINSC - Send (echo) ASCII value to CRT 

~RINSC: TSTB WTPS ;IS CRT READY? 

44 
BPL 

MOVB 

RTS 

; 

3 

"BUF: .BLKB 

KEYNUM: .WORD 

KEYLEP: .WORD 

MASK: .WORD 

; 

OUT1 : 

Om: 

OUT3 : 

OUT4 : 

OUT5 t 

OUT6 t 

OUT7 : 

OUT8 a om9 t 

OUT10 : 

OUT11 : 

OUT12 : 

; 

.ASCII 

.ASCII 

.ASCII 

.ASCII 

.ASCII 

.ASCII 

.ASCI I 

.ASCII 

.ASCII 

.ASCII 

.ASCII 

.ASCII 

.END 

PRINSC ;WAIT IF NOT 

RO ,B#TPB . ;OUTPUT CHARACTER 

PC ;REXWW FROM SUBROUTINE 

10 

0 ;Keyboard input value 

177 ;Keyboard input letter, starts as DELETE 

0 ;Input vectoring mask 

;Dummy storage for values from query routine 

<33)/7/<0) 

<33)/C/ 

/4;30H/<O) 

(33) /8/<0) 

<40><40)<40)<40)<0) 

<33)/C4;57H/<O) 

/ON /<O> 

f OFF/<O) 

(33) /C5;57H/ <O) 

<33)/C6;57H/<O) 

<33)/12K/<15)(0) 

(33)/C8;58H/<O) 

;Save cursor position 

;Start cursor move command 

;Move cusor to line A, column 30 

;Restore cursor position 

;Spaces for blanking previous value 

;Move cursor to INTEGF?ATOR= 

;ON message 

;OFF message 

;Move cursor to DRAG 1NT.x 

;Move cursor to OUTPUTS= 

;Blank present input line 

;Move cursor to AUTO ROUTINE 

45 
START. MAC 

.TITLE START :PROGRAM TITLE 

; 

.............................................................................. 

; Purpose: Access data required by real-time code, initialize hardware 

i interrupts, provide system error traps 

; 

; Environment: Executes once only, some system interrupts already disabled 

; prior to module entry 

i 

; Related modules: 

i 

i 

; WLQ Iiv: 

I 

i addressing. All arrays remain valid on exit 

; 

; Variables: ICWS is FORTRAN CHARS array, CHARS is local CHARS copy ;""-"'---""----'-"-"""""-------------------------------------- 

i 

; 

Called by MSBS, calls USERIO, with interrupt to CNTROL 

ac t iva t ed 

Accesses OSCIii, IXTA, COWiAii and Cis arrays from FORT'.G'G-. 

CHARS array is copied to local version for faster real-time 

trn 

.GLOBL CHARS,DATA,OSCILL,COMMAN ;DATA ARRAYS 

.MCALL .TRPSET,.MIT,.PRINT ;SYSTEM MACROS 

.MCALL CONFIG,DFCHAR,OUTPUT ;CONFIGURATION MACRO 

; 

;FETCH 110 DEVICE ADDRESSES 

i 

; 

;SAVE DATA ACROSS FORTRAN CALLING INTERFACE 

; 

START: r TST (R5)+ ;SKIP SUBROUTINE ARGUMENT COUNT 

MOV (R5)+,03CILL ;STORE ADDRESS OF OSCILLATOR ARRAY 

MOV (R5) ,COMMAN ;STORE ADDRESS OF COMMAND ARRAY 

MOV (RS),COt"+? ;ARCHIVE C0I"D ARRAY ADDRESS 

MOV (R5 1 + ,COMMAN+4 ;TWICE 

MOV (RS) ,DATA ;STORE ADDRESS OF DATA ARRAY 

MOV (R5)+,DATA+2 ;ARCHIVE ARRAY ADDRESS 

MOV (R5 1 +, ICHARS ;STORE ADDRESS OF CHARS ARRAY 

CONFIG ;SYSTEM CONFIGURATION AND DEFINITIONS 

; 

; 

;COPY ICHARS ARRAY TO LOCAL ARRAY CHARS 

CLR R1 ;CLEAR INDEX REGISTER 

MOV ICHARS ,RO ;FETCH ADDRESS OF ICHARS ARRAY 

ADD P2. ,R1 ;INCREMENT CHARS ARRAY INDEX 

CMP #190. ,R1 ;ARE WE AT THE LAST ELEMENT YET? 

BPL COPY ;LOOP BACK IF NOT 

COPY: MOV (RO)+,CHARS(Rl) ;COPY VALUE ACROSS TO CHAR3 ARRAY 

i 

;ACTIVATE RUN-TIME TRAP HANDLER 

: 

i 

i8FT UP LOOP RATE CLOCK, WITH INTERRUPTS ENABLED 

; 

. TRPSFT UEMTARG, #SRESET ;CALL RTll TRAP CATCHER 

MOV #CNTROL,@#CLZV ;SEX UP NEW CLOCK VECTOR 

MOV #30O,@#CL2V+2 ;PROCESSOR STATUS WORD FOR INTERRUPT 

;PROCESSOR RUNS AT PRIORIW 6 DURING 

; IWTERRUPT 

MOV #170275,@YCL2B JCLOCK COUNTER IS 3906 (DEC.) COUNT3 

MOV #113,@#CL2S ;SFT CLOCK F'UNDAMENTAL TO 1 MHZ 

;LOOP RATE IS 256 HZ 

46 
;INTERRUPTS ENABLED 

* 

:CALL KEYBOARD "Dm - CNTROL will interrupt in 1/256 seconds 

; 

; 

CLSm : 

i 

; 

ABNDN : 

I 

:SYSTEM 

SRESET : 

i 

; 

OSCILL: 

ICHARS : 

DATA : 

COMMAN : 

CHARS : 

; 

kMTARG: 

TRAPM : 

JSR PC , USER10 ;CALL TO USERIO, RE2UR.N ON CLOSEDOMN 

BIC #lOO,@#CL23 

CLR RO 

OUTPUT 0 

OUTPUT 1 

OUTPUT 2 

OUTPUT 3 

OUTPUT 4 

CMP #340,@#PSW 

ABNDN 

PC 

BEQ 

RTS 

;TURN OFF CLOCK INTERRUPTS 

;LOAD RO WITH ZERO CURRENT DEMAND 

;KILL CHANNEL 0 

;AND 1 

;Ex. 

; 

i 

;IS THIS A CLOSEDOWN OR A CRASH? 

;JUMP IF THIS IS A CRASH 

;REI" TO FORTRAN IF NOT 

. EXIT ;SYSTEM CRASH 

SHUTDObIN WITH ERROR DETEXTED 

MOV #340,@#PSW 

.PRINT #TRAPM 

BR CLSDWN 

.EXIT 

.WORD 0 

.WORD 0 

.WORD 0,o 

.WORD o,o,o 

.BLKW 96. 

DFCHAR 

;RAISE PROCESSOR STATUS TO 7 

;PRINT MESSAGE TO CRT 

;JUMP TO CLOSEDOWN ROUTINE 

;ADDRESS OF OSCILLATOR ARRAY 

iC0M"D DATA ARRAY ADDRESS 

;ADDRESS AND ARCHIVE OF DATA ARRAY 

;ADDRESS OF PREPROGRAMMED ARRAY 

;COPY OF COMMAND ARRAY DATA 

.WORD 0,o 

.ASCI2 /?ABORT - TRAPPED TO 4 OR lo?/ 

.END 

47 
CNTROL. MAC 

.TITLE CNTROL ;PROGRAM TITLE 

i 

.............................................................................. 

: Purpose: 

i 

; Eslvironment: 

i previously executing code 

CNTROL performs all real-time control and data acquisition 

Starts following clock interrupt, executes once, returns to 

i 

; Related modules: 

i 

USER10 is the module interrupted and returned to. Only 

RO, R1 and R2 are preserved by CNTROL. 

; 

; Data I/O: ' OSCILL contains sinewave data. DATA is used for seuuential 

i storage of real-time data. CHARS carries in keyboard commands 

; in near real-time, COMMN carries in preprogrammed routines. 

i 

i Variables: OUTFLG is output on/off flag (O=off, otherwise on) 

i INTFLG is main integrator flag (h) 

; DRGFLG is axial integrator flag (HI 

i DATFLG is data acquisition flag (E, number of sweeps) 

i OVRFLW is number of data sweeps left before overflow 

i SAMPLE is number of channels of real-time data (dummy var.) 

i AUTnG Is number of auto routines to run (g) 

i AUTNUM is loaded auto routine number (GI 

;-'-""-"--"-"'-----"-"----"-"--------------------------

; 

i 

. GLOBL CHARS .DATA, OSCILL ,COMMAN ;DATA ARRAYS 

. MCALL !l"SL, ROTATE, PHASEF , OUTPUT ;AND REQUIREXI MACROS 

.MCALL INTM;,INTEG2,ADST,DAST i 

. MCALL PREPRG ,F'LPF'LP , OUTpU2 ,ADCLS ; 

.WALL CONFIG,ADST2,ADCLS2,DIGSCN i 

i 

; 

i INITIALIZE LABELS 

CONFIG ;SYSTEM CONFIGURATION 

3AMPLE.O ;Sa DATA ACQUISITION CHANNEL COUNTER 

i 

........................................................................ 

; MAIN LOOP START, CALLED FROM CLOCK INTERRUPT 

CNTROL : : BIC #200,@#CL2S ;CLEAR INTERRueT FLAG OF CLOCK 

; 

MOV RO , - ( SP) ;PUSH RO 

MOV R1, - ( SP) ;AND R1 

MOV R2, - (SP) ;AND R2 

; 

; CHANGE R6 TO DATA STACK 

i 

MOV SP , STACK ;ARCHIVE SYSTEM STACK POINTER 

MOV DATA, SP ;SEX! UP DATA STACK 

; 

; INCREHENT MASTER OSCILLATOR 

; 

INC OX 

BIC #176000,0SC 

;INCREMENT MASTER COUNTER 

;TRUNCATE COUNTER TO 10 BITS 

i 

a COMPUTE MODEL POSITION AND ATTITUDE 

i 

i 

;~&&**********~************~**&***************************************** 

DIOSCN ;SCAN DIGITAL INPUT PORTS 

MOV AL ,R1 ;FETCH POSITION SENSOR DATA 

48 
MOV FL .R5 ;AL=AFT LEFT, F'L-FORWARD LEEll 

MOV AU,R3 ;AU=AFT UPPER, FU=FORRARD UPPER 

MOV N,R4 ;AX=AXIAL 

MOV AX,R2 ; 

MOV #1777,R0 ;FETCH VERTICAL OFF'SFT (1023. PIXELS) 

SUB R5 ,RO ;SUBTRACT F'L 

SUB R1 ,RO ;AND At 

MOV RO ,VERT ;STORE VERTICAL POSITION 

DAST . RO ;STORE AS DATA 

MOV R5 ,RO ;FETCH F'L 

SUB R1 ,RO ;SUBTRACT AL 

MOV RO ,PITCH ;STORE PITCH ATTITUDE 

DAST RO ;STORE AS DATA 

HOV 411777 ,RO ;FETCH LA- OFFSET (1023. PIXELS) 

SUB R3 ,RO ;SUBTRACT AU 

SUB R4 ,RO ;AND mr 

MOV RO ,LAT ;STORE LATERAL POSITION 

DAST RO ;STORE AS DATA 

MOV R3 ,RO ;FETCH AU 

SUB R4 ,RO ;SUBTRACT FU 

MOV RO ,YAW ;STORE YAW ATTITUDE 

DAST RO ;STORE AS DATA 

; 

;VERTICAL 

i 

;PITCH 

; 

;LATERAL 

i 

;YAW 

i 

;AXIAL 

MOV R2 ,RO ;FETCH AX 

SUB #777 ,RO ;SUBTRACT AXIAL OFFSET 

ASL RO ;TIMES 2 FOR SIMILAR SENSITIVITY 

MOV RO ,AXIAL ;STORE AXIAL POSITION 

DAST RO ;STORE AS DATA 

; 

; LOOP RATE INDICATOR FLIP 

8 

; 

........................................................................ 

; COMPENSATOR, WITH INTERLEAVED DATA ACQUISITION 

; 

;START A/D CHANNEL 0 

FLPF'LP 5,2000 ;SETS CHANNEL 5 D/A TO -2.5V APPROX. 

ADST 0 ;CHANNEL 0 IS DRAG 

; 

;VERTICAL 

PHASEF vERT,vT,0.64,17.9,3.11 ;PHASE ADVANCE VERTICAL POSITION 

TRANSL CHARS,OSCILL,3 ;ADD IN USER DRIANDS 

MUL VG,R2 ;vwTICAL GAIN. DROP LOW ORDER PRODUCT 

Im CHARS,VINT ; INTEGRATOR 

MOV R2 ,VO ;STORE VERTICAL DEMAND 

; 

;COLLECT AID AND START NEXT 

ADCLS ; 

ADST 1 ;CHANNEL 1 IS BIAS 1 

; 

;PITCH 

PHASEF PITCH,PT,0.64,17.9,3.11 ;PHASE ADVANCE PITCH ATTITUDE 

49 
ROTATE CHARS .OSCILL . 2 

MUL PG,R2 

INTM; CHARS,PINT 

MOV R2 ,PO 

; 

;COLLECT A/D AND START NEXT 

ADCLS 

ADST 2 

; 

;LATERAL 

PHASEF LAT.LT.O.64.17.9.3.11 

TRANSL CHARS.OSCILL.2 

MUL LG,R2 

INTEG CHARS,LIN!r 

MOV R2 ,LO 

; 

;COLLECT A/D AND START NEXT 

ADCLS 

ADST 3 

; 

; YAW 

PHASEF YAW,YT,0.64,17.9.3.11 

ROTATE CHARS.OSCILL.3 

MUL YG,R2 

INTM; CHARS,YINT 

MOV R2 ,YO 

ADCLS 

ADST 4 

; 

;COLLECT AID AND START NGirr 

; 

;AXIAL 

PHASEF AXIAL.AT.0.64.17.9.3.11 

TRANSL CHARS.OSCILL.1 

MUL AC .R2 

INTEG2 CHARS,AINT 

MOV R2 ,A0 

; 

;COLLECT A/D AND START 

ADCLS 

ADST 

; 

; MODEL OUT DE;TECTOR 

; 

TST OUTFLG 

BNE MODIN 

MODOUT: CLR vo 

CLR 

CLR 

CLR 

CLR 

CLR 

CLR 

CLR 

CLR 

CLR 

CLR 

CLR 

MODIN : 

PO 

LO 

YO 

A0 

VINT 

PINT 

LINT 

Y INT 

AINT 

INTFLG 

DRGFLG 

5 

;ADD IN USER DEMANDS 

;PITCH GAIN 

; INTEGRATOR 

;STORE PITCH DEMAND 

; 

;CHANNEL 2 IS BIAS 2 

;PHASE ADVANCE LATERAL POSITION , ,Ann --- IN cpx.9~ 

;LATERAL GAIN 

; INTEGRATOR 

;STORE LATERAL DEMAND 

I 

;CHANNEL 3 IS BIAS 3 

;PHASE ADVANCE YAW ATTITUDE 

;ADD IN USER DEMANDS 

;YAW GAIN 

; INTEGRATOR 

;STORE YAM DEMAND 

; 

;CHANNEL 4 IS BIAS 4 

;PHASE ADVANCE AXIAL POSITION 

;ADD IN USER DEMANDS 

;AXIAL GAIN 

; INTEGRATOR 

;STORE AXIAL DEMAND 

; 

;CHANNEL 5 IS CONTROL 1 

;IS 3 O? 

;JUMP TO OUTPUTS IF NOT 

;CLEAR ALL FINAL DEMANDS 

;IF MODEL IS OUT 

; 

; 

; 

;INCLUDING HIGH ORDER 

;INTEGRATOR ACCUMULATORS 

8 

; 

8 

;TURN MAIN INTEGRATORS OFF 

;ALSO DRAG INTEGRATOR 
; OUTPUTS WITH INTERLEAVED DATA ACQUISITION 

; 

;E/M 1, AFT PORT, OUTPUT 

MOV YO ,RO ;FETCH YAW DEMAND 

SUB VO ,RO ;SUBTRACT VERTICAL DEMAND 

SUB PO ,RO ;SUBTRACT PITCH DEMAND 

SUB LO ,RO ;SUBTRACT LATERAL DEMAND 

OUTPUT 0 ;CALL OUTPUT ROUTINE 

; 

;COLLECT AND START A/D 

ADCLS ; 

ADST 6 ;CHANNEL 6 IS CONTROL 2 

; 

;EM 2, FORWARD PORT, OUTPUT 

' MOV PO ,RO ;LOAD RO WITH PITCH DEMAND 

SUB VO ,RO ;SUBTRACT VERTICAL 

SUB LO ,RO ;SUBTRACT LATERAL 

OUTPUT 1 ;CALL OUTPUT ROUTINE 

MOV LO ,RO ;LOAD RO WITH LATERAL 

SUB VO ,RO ;SUBTRACT VERTICAL 

SUB PO ,RO ;SUBTRACT PITCH 

SUB YO ,RO ;SUBTRACT YAW 

OUTPUT 2 ;CALL OUTPUT ROUTINE 

SUB YO ,RO ;SUBTRACT YAW 

; 

;AFT STARBOARD OUTPUT 

; 

;COLLECT AND START A/D 

ADCLS ; ADST 7 ;CHANNEz 7 IS CONTROL 3 

;FORHARD STARBOARD OUTPUT 

i 

~ 

MOV PO ,RO ;LOAD RO WITH PITCH 

ADD LO ,RO ;ADD LATERAL 

ADD YO ,RO ;ADD YAW 

SUB VO ,RO ;SUBTRACT VERTICAL 

OUTPUT 3 ;CALL OUTPUT ROUTINE , 

;AXIAL OUTPUT 

MOV A0 ,RO ;FETCH AXIAL DEMAND 

OuTPU2 4 ;CALL OUTPUT ROUTINE 

; 

;COLLECT AID AND START NEXT 

ADCLS ; ADST2 0 ;CHANNEL (2)O IS CONTROL 4 

; 

; LOOP RATE INDICATOR FLOP 

; 

: 

FLPFLP 5.-2000 ;SETS CHANNEL 5 D/A TO +2.5V APPROX. 

;COLLECT A/D 

; 

; PRESERVE DATA ? 

; 

ADCLS2 I 

.............................................................................. 

TST DATFLG ;IS C SET +vE (STORE) ? 

BEQ NOSAMP ;JUMP OUT IF NO 

TST OvRmkJ ;LOOK FOR DATA OVERFLOW 

BE9 NOSAMP ;JUMP OUT IF YES 

DEC DATF'LG ;REDUCE CYCLE COUNTER 

. 

51 
DEC OVRFLW ;REDUCE OVERFLOW COUm 

BR ENDSMP ;KEEP DATA AND JUMP OUT 

NOSAMP: SUB #SAMPLE?SP ;DISCARD DATA 

ENDSMP: 

i 

;PREpROGRAMMED ROUTINE MECUTION 

i 

;RESTORE SYSTM STACKS, RETURN TO PREVIOUSLY EXECUTING CODE 

JUMPST: MOV SP , DATA ;ARCHIVE DATA STACK POINTER 

PREPRG CHARS,COMMAN ;CALL PREPROGRAMMED ROUTINE 

? 

; 

MOV STACK SP ;RESTORE SYSTEM STACK 

MOV SP 1 + .R2 ;POP R2 

MOV ( SP 1 + .R1 ;POP R1 

MOV (SP) + ,RO ;POP RO 

RTI ;RmN TO USER10 FROM INTERRUPT 

: 

; 

; DEXLARE VARIABLES ........................................................................ 

; 

; 

STACK : 

vo : 

PO : 

LO : 

YO : 

A0 : 

VT: 

PT: 

LT : !m: 

AT : 

VINT 1 

PINT: 

LINT: 

YINT: 

AINT : 

; 

; 

; 

.WORD 

.WORD 

.WORD 

.WORD 

.WORD 

.WORD 

. FZT2 

. FLT2 

. FLT2 

. FLT2 

. FLT2 

.WORD 

.WORD 

.WORD 

.WORD 

.WORD 

. END 

0 

0 

0 

0 

0 

0 

0. ,o. 

0. ,o. 

0. ?O. 

0. ,o. 

0. ,o. 

0,o 

O?O 

O?O 

O?O 

0.0 

;SYSTEM STACK POINTER 

;VERTICAL CURRENT DEMAND 

;PITCH DEMAND 

:LATERAL DEMAND 

;YAW DEMAND 

;AXIAL DEMAND 

;INTERMEDIATE DATA STORAGE 

;FOR PHASE ADVANCERS 

; 

; 

; 

;INTM;RATOR ACCUMULATORS 

; 

; 

; 

? 

52 
CNTRLB . MAC 

............................................................................. 

i 

i THE MACRO ROUTINES CONTAINED IN THIS LIBRARY ARE AS FOLLOWS :: 

i 

i TRANSL X,Y,Z TRANSLATOR/OSCILLATOR 

i ROTATE YAW,PITCH,ROLL ROTATOR/OSCILLATOR 

i 

; 

: 

i 

i 

i 

; 

; 

i 

I 

i 

i 

PHASEF 

INTM; 

1m2 

OUTPUT 

ouTPu2 

ADCL 

ADCLZ 

ADCLS 

ADcLS2 

PROGRAMMABLE DUAL PHASE ADVANCE 

FIXED PARAFEER ERROR INTEGRATOR 

AUXILIARY FIXED PARAMFTER (DRAG) INTEERATOR 

D/A OUTPUT ROUTINE AND OVERFLOW CLAMP 

DRAG D/A OUTPUT ROUTINE 

FETCH READY A/D DATA (BOARD 1) 

FE;TCH READY A/D DATA (BOARD 2) 

FETCH A/D DATA AND STORE ON STACK (BOARD 1) 

FEKH A/D DATA AND STORE ON STACK (BOARD 2) 

i 

; ADST INITIATE A/D CONVERSION (BOARD 1) 

i ADST2 INITIATE AID CONVERSION (BOARD 2) 

i 

i TIME1 MARK TIME FROM CLOCK 1 ON STACK 

i TIME2 MARK TIME FROM CLOCK 2 ON STACK 

i DAST STORE AVAILABLE DATA ON STACK 

i PREPRG PREPROGRAMMED ROUTINE EXECUTION 

; FLPFLP LOOP RATE INDICATOR F'LIP/FLOP 

i 

i DIGSCN SCAN DIGITAL INPUT PORTS FOR POSITION DATA 

i 

.............................................................................. 

i 

.............................................................................. 

;FULL TRANSLATOR/OSCILLATOR FOR X,Y,Z; 

i Input data in R5, output to R2 

i NUM Is d-o-f, l=axial, 2=lateral, 3=vertical 

; 

.-------------------------------------------------------------------

i 

i 

i 

. MACRO 

SUB 

SUB 

MOV 

MOV 

MOV 

MUL 

ADD 

BIC 

ASL 

ADD 

MOV 

MOV 

MUL 

NEG 

ADD 

.ENDM 

TRANSL CHARS, OSCILL , NUH 

CHAR3+<2*(NUM+127)),R5 ;ADD M3 OFFSET TO R5 

CHARS+(2*(NUM+67>),R5 ;AUXILIARY DISPLACEMENT 

CHAR3+(2*136),Rl ;GEr MASTER COUNTER 

CHARS+(2*(NUM+121>>,R2 ;LOAD PHASE 

CHARS+<2*(NUM+llO)),R3 ;LOAD FREQUENCY 

R3 ,R1 

R2 ,R1 ;INCREMENT COUNTER FOR PHASE 

#176000,Rl ;REDUCE COUNTER TO 10 BITS 

R1 ;CONVERT R1 TO WORD ADDRESSING 

OSCILL , R1 ;ADD OSCILLATOR BASE ADDRESS 

(R1) ,R2 ;GET RELEVANT OSCILLATOR VALUE 

CHARS+<2*(NUM+lOO>),R4 ;GET AMPLITUDE 

R4 ,R2 ;OSCILLATION AMPLITUDE 

R2 ;CORRECT SIGN OF OSCILLATOR 

R5,R2 ;ADD OSCILLATOR TO R5 

TRANSL 

;INCREMENT COUNTER FOR FREQUENCY 

;LOW ORDER PRODUCT ONLY RETAINED 

;OVERFLOW IGNORED 

;HIGH ORDER PRODUCT USED 

53 
.............................................................................. 

;FULL ROTATOR/OSCILLATOR FOR ROLL/PITCH/YAW 

; Input In R5, output to R2 

; NUM is d-o-f, l=roll, 2=pitch, 3=yaw 

.MACRO ROTATE CHARS,OSCILL,NUM 

SUB CHARS+(2*<NUM+113)),R5 ;ADD DC OFFSET TO R5 

SUB CHARS+(2*(NUM+54)),R5 ;AUXILIARY DISPLACP'lENT 

;INPUT DATA IN R5 

MOV . CHARs+(2k136) ,R1 ;GET MASTER COUNTER 

HG'V' 2i3+(2~<N-U-M+lZ4)) ,R2 ;LOAD PHASE 

MOV CHARS+(2*(NUM+116)>,R3 ;LOAD FREQUENCY 

MUL R3 ,R1 ;INCREMENT COUNTER FOR FREQUENCY 

ADD R2 ,R1 ;INCREMENT COUNTER FOR PHASE 

BIC #176000 ,R1 ;REDUCE COUNTE3? TO 10 BITS 

ASL R1 ;CONVERT R1 TO WORD ADDRESSING 

ADD OSCILL,Rl ;ADD OSCILLATOR BASE ADDRESS 

MOV (R1) ,R2 ;GET RELEVANT OSCILLATOR VALUE 

MOV CHARS+(2A(NUM+103)),R4 ;GET AMPLITUDE 

MUL R4 ,R2 ;OSCILLATION AMPLITUDE 

NEG R2 ;CORRECT SIGN OF OSCILLATOR 

ADD R5 ,R2 ;ADD OSCILLATOR TO R5 

.ENDM ROTATE 

;OUTPUT TO R2 

; 

; 

.............................................................................. 

; DUAL PHASE ADVANCER 

; Input data from SOURCE, output to R5 

; Y, Y+4. are Intermediate results. L1, L2, GAIN are parameters , POS,NEG,FINISH are local symbols .-------------------^___________________-----------------

; 

; 

.MACRO PHASEF SOURCE,Y,Ll,L2,GAIN,?POS,?NEG,?FINISH 

ACO=%O ;DEFINE FLOATING POINT REZISTERS 

AC1=%1 

AC2=%2 

AC3=%3 

AC4=%4 

AC5=%5 

8 

: INPUT VALUES Ll,L2 CORRESPOND TO : 

; Ll-T/(T+DT) ? L2 =N*T/M' 

; GAIN=lO.k((M'/T)**2) 

; 

: OVERALL D.C. GAIN = 10 (CONVENIENCE ONLY) 

i 

I AAPROXIMATE VALUES FOR 256 HZ LOOP RATE AND N=10 AS FOLLOWS : 

: 

I T I 0.007 0.006 0.005 0.004 0.003 

: L1 I 0.64 0.61 0.56 0.51 0.43 

; L2 I 17.9 15.4 12.8 10.2 7.7 

I GAIN I 3.11 4.24 6.10 9,54 16.95 

; 

; GET INPUT VALUE 

............................................. 

; 

LDCIF SOURCE ,ACO 

MULF #GAIN,ACO 

54 

;ACO=DEMAND POSITION (P) 

;CORRECT GAIN TO 8 OVERALL 
; 

; FIRST PHASE ADVANCE 

; 

LDF Y ,AC1 

ADDF AC1,ACO 

MULF #Ll,ACO 

STF AC0,Y 

SUBF AC0,ACl 

MULF #-L2,ACl 

ADDF AC0,ACl 

; 

; 

; SECOND 

LDF Y+4. , AC2 

ADDF AC2,ACl 

MULF #Ll,ACl 

STF ACl,Y+Q. 

SUBF AC1,ACZ 

MULF #-L2,AC2 

ADDF ACl,AC2 

; 

; 

; OVERFLOW CLAMPS 

CMPF 016303. ,AC2 

CFCC 

BMI 

CMPF 

CFCC 

BPL 

STCFI 

BR 

BR 

POS I MOV 

NED: MOV 

FINISH: 

; 

; 

.ENDM 

PO3 

#-16303.,AC2 

NED 

AC2 ,RS 

FINISH 

#l6303.,R5 

FINISH 

#-16303.,R5 

PHASEF 

;ACl=Yl(K-l) 

;ACO=P+Yl(K-l) 

;ACO=Yl(K) 

;UPDATE Yl(K-1) TO Yl(K) 

;ACl=Yl(K-l)-Yl(K) 

;ACl=X*(Yl(K)-Yl(K-l) 1 

;ACl=Y2(K) 

;REPEAT FOR SECOND 

;COMPARE TO HALF INTEGER OVERFLOW ................................. 

;THIS IS AN ARBITRARY VALUE AND 

;PROCEDURE AND IS CAPABLE OF 

;PRODUCING INCORRECT OR UNPREDICTABLE 

;RESULTS WITH UNUSUAL OUTPUT DEMAND 

;MIXING 

;A******************************* 

;COPY CONDITION CODES TO CPU 

;BRANCH TO POSITIVE LIMITER 

;COPY CONDITION CODES 

;BRANCH TO NEGATIVE LIMITER 

;STORE RESULT IN MAIN REGISTER 

;DONE HERE 

;POSITIVE LIMITER 

;DONE HERE 

;NEGATIVE LIMITER 

;COMPARE TO -HALF INTEGER 

.............................................................................. 

;STANDARD -OR INTEGRATOR 

; Source data in R2, accumulator is INT, uses "h" as flag 

; OFF is local symbol .------------------------------------------------------------------

; 

.MACRO INTEG CHARS,IN!C,?OFF 

MOV INT,RO ;FETCH PRESENT INTEGRATOR ACCUMULATOR 

MOV INT+2. ,R1 ;(HIGH AND LOW WORDS) 

TST 1"LG ;ARE MAIN INTEGRATORS ON? 

BE!? 

MOV R2 ,R4 

OFF ;JUMP FORWARD IF NO 

;STORE POSITION ERROR 

CLR R5 

ASHC #-12,R4 

ADD R5 ,R1 

ADC RO 

I 

;POSITION ERROR * KdT 

;ADD PRESENT INTEGRATOR VALUE TO 

;INTM;RATOR ACCUMULATOR 

55 
ADD R4 ,RO 

OFF': ADD RO ,R2 

MOV RO , INT 

MOV R1, INT+2. 

; 

;POSITION ERROR+INT€GRATOR ACCUMULATOR 

;RESTORE INTEGRATOR ACCUMULATOR 

i 

;INTM;RATORS ARE NOT OVERFLOW LIMITED 

i 

. MACRO 

MOV 

MOV 

T3T 

BEQ 

MOV 

CLR 

ASHC 

ADD 

ADC 

ADD 

OFF: ADD 

1m2 CHARS, INT,?OJ?F 

INT,RO 

INT+2. ,R1 

DRGF'LG 

OFF 

R2 ,R4 

R5 

#-12 ,R4 

R5 ,R1 

RO 

R4 ,RO 

RO .R2 

;F'EZK" PRESENT INTEGRATOR ACCUMULATOR 

;(HIGH AND LOW WORDS) 

;IS DRAG INTEGRATOR ON? 

;JUMP FORWARD IF NO 

;STORE POSITION ERROR 

i 

;POSITION ERROR * KdT 

;ADD PRESENT 1NTM;RATOR VALUE TO 

;INTEGRATOR ACCUMULATOR 

; 

;POSITION ERROR+INT€GRATOR ACCUMULATOR 

MOV RO , INT ;RESTORE 1NTM;RATOR ACCUMULATOR 

MOV R1, IN!C+2. I 

.E" INTEE2 

;INTM;RATORS ARE NOT OVERFLOW LIMITED 

i 

i 

.............................................................................. 

;D/A OUTPUT ROUTINE AND OVERFLOW CLAMPER 

i Input in RO, output direct to D/A channel 

i NEGCLM, POSCLM, FINISH are local symbols .--------------------------------------------------------------

.MACRO OUTPUT CHA",?NEGCLM,?POSCLM,?FINISH 

ZERO I =60 0 0 ;NOMINAL ZERO CURRENT D/A VALUE 

ADD #ZERO1 ,RO ;INCLUDE SOFTWAR€ BIAS FOR D/A 

i 

i 

;2047.=0 VOLTS 

;LOOK FOR NEGATIVE OVERFLOW 

BMI NEGCLM ;BRANCH TO NEGATIVE OvERnOW CLAMP 

CMP #7777 ,RO ;LOOK FOR POSITIVE OVERFLOW 

BMI POSCLM ;BRANCH TO POSITIVE OVERFLOW CLAMP 

BR FINISH ;DON€ HERE 

BR FINISH ;DONE HERE 

POSCLM: BIS 87777 ,RO ;FORCE POSITIVE CLAMP 

NMZCLH: BIC #7777 ,RO ;FORCE NEGATIVE CLAMP 

FINISH: MOV RO,O#(OUT+(CHANNA2)) ;OUTPUT TO D/A 

.ENDM OUTPUT ;DONE 

; 

i 

i 

.............................................................................. 

;D/A OUTPUT ROUTINE AND OVERFLOW CLAMPER 

I Input In RO, output dlrect to D/A channel 

; NEGCLH, POSCLM, FINISH are local symbols ;'-"'---'--""""""""""""'-"-------------------------------------- 

56 
.MACRO OUTPU2 C"N,?NM;CLM,?POSCLM,?FINISH 

ZERO1 =400 0 ;NOMINAL ZERO CURRENT D/A VALUE 

ADD #ZERO1 ,RO ;INCLUDE SO- BIAS FOR D/A 

;2047.=0 VOLTS 

;LOOK FOR NEGATIVE OVERFLOW 

BMI NEOCLM ;BRANCH TO "EGATIVE OVERFLOW CLAMP 

#7777 ,RO ;LOOK FOR POSITIVE OVERFLOW 

;BRANCH TO POSITIVE OVERFLOW CLAMP 

;DONE MERE 

POSCLM: BIS #7777 ,RO ;FORCE POSITIVE CLAMP 

BR FINISH ;DONE HERE 

NEECLM: BIC #7777 ,RO ;FORCE IWGATIVE CLAMP 

FINISH: MOV RO,@#(OUT+(CHANNk2)) ;OUTPUT TO D/A 

.ENDM OUTPU2 ; DONE 

k! . PY8EH 

i 

i 

i 

.............................................................................. 

;AID BOARD 1 CONVERSION READY TEST AND DATA COLLECT 

i Data from AID board 1, placed in DEST 

i TEST Is local symbol .----------------------------------------------------------------------------- 

i 

TEST: TSTB @#ADlSR ;IS A/D DONE? 

.MACRO ADCL DEST,?TEST 

BPL TEST ;WAIT IF NO 

MOV @#ADlBR, DEST ;STORE INPUT DATA (CLEARS DONE BIT) 

.ENDM ADCL 

; 

i 

i 

.............................................................................. 

;AID BOARD 2 CONVERSION READY TEST AND DATA COLLECT I Data from A/D board 2, placed in DEST I TEST is local symbol .---------_--------------------------------------------------------

i 

TEST: TSTB @#AD2SR ;IS A/D DONE? 

.MACRO ADCL2 DEST,?TEST 

BPL TEST ;WAIT IF NO 

MOV @#ADZBR,DEST ;STORE INPUT DATA (CLEARS DONE BIT) 

.ENDM ADCL2 

i 

, 

i 

;A/D BOARD 1 COLLECT ROUTINE FOR DATA ACQUISITION 

; Data from A/D board 1, placed on stack 

i TEST2 is a local symbol 

.............................................................................. 

.___________________------------------------------------

* 

i 

.MACRO ADCLS ?TEST2 

SAMPLE=SAMF'LE+2 ;INCREMENT DATA COUNTER 

BPL TEST2 ;WAIT IF NO 

MOV @#ADlBR,(SP)+ ;PUSH DATA ON STACK (CLEARS DONE BIT) 

.ENDM ADCLS 

TEST2: TSTB @#ADlSR ;IS A/D DONE ? 

; 

57 
i 

; 

.............................................................................. 

;A/D BOARD 2 COLLECT ROUTINE FOR DATA ACQUISITION 

; 

i TEST2 is a local symbol 

Data from A/D board 2, placed on stack 

.___________________-~--------------------------

I 

i 

TEST2: TSTB @#AD2SR ;IS AID DONE 3 

.MACRO ADCLS2 ?TEST2 

SAMPra=SAMPLE+2 ;INCRPIIENT DATA COUNTER 

BPL TEST2 ;WAIT IF NO 

MOV @#ADZBR,(SP)+ ;PUSH DATA ON STACK (CLEARS DONE BIT) 

i 

.ENDM ADCLS2 

; 

; 

.............................................................................. 

; CHANN is channel address (0-8) 

;START DATA ACQUISITION ON BOARD 1 

.-----------------------------------------------------~-------------

; 

.MACRO ADST C"N 

MOV #<(CHANN*400)11),~#ADlSR ;INITIATE AID COMlERSION 

.E" ADST 

; 

; 

.............................................................................. 

;START DATA ACQUISITION ON BOARD 2 

i CHANN is channel address (0-8) 

i 

.---------------------------------------------------------------

.MACRO ADST2 CHANN 

MOV #((CHA"*400>11),~#AD2SR ;INITIATE A/D CONVERSION 

.E" ADST2 

; 

i 

.............................................................................. 

;TIME MARK FROM CLOCK 1 ? Push time on 8tack 

.----------------------------------------------------------------------

i 

.MACRO TIME 

SAMPLE=SAMPLE+2 ;INCRP1ENT DATA COUNTEX? 

MOV @#CLlB,(SP)+ ;PUSH TIME ON STACK, INC SP 

.ENDM TIME 

; 

i 

.............................................................................. 

;TIME MARK FROM CLOCK 2 

: Push time on stack 

i 

.----------------------------------------------------------------------------

.MACRO TIME2 

SAMPLE=SAMPLE+2 ;INCREMENT DATA COUNTER 

HOV @#CLZB.(SP)+ ;PUSH TIME ON STACK, INC SP 

.ENDM TIME 

; 

; 

.............................................................................. 

;DATA STORE 

58 
i Push SOURCE data on stack 

; 

.---------------------------------------------------------------------

.MACRO DAST SOURCE 

SAMPLE=SAMPLE+Z ;INCFG"T DATA COUNTER 

MOV SOURCE,(SP)+ ;PUSH DATA ON STACK,INCRPIENT SP 

.ENDM DAST 

; 

i 

.............................................................................. 

;PREPROGRA"ED ROUTINE MECUTION 

i 

; AUTO, NOAUTO, AUTCOM, AU"D are local symbols 

; 

i 

CHARS and COMMAN arrays are accessed 

.--------------------------------------------------------------

.MACRO PREPRG CHARS,COMMAN,?AUTO,?NOAUTO,?AUTCOM,?AUTE 

AUTO: TST CHARS+ ( 2* 10 7 ) ;IS AUTO ROUTINE CONTROL Pm 

;(GI SEI' POSITIVE? 

NOAUTO ;JUMP OUT IF NOT 

CHARS+<2*134) ;IS THIS AUTO COMMAND COMPLETED? 

BEQ 

TST 

BNE AUTCOM ;JUMP OUT IF NOT 

MOV COMMAN,RO ;LOAD POINTER TO THIS COMMAM> DURATION 

MOV (RO)+,CHARS+(2k134) ;LOAD THIS COMMAND DURATION 

AUTEND ;JUMP IF THIS IS THE TERMINATOR 

(RO )+ ,R1 ;FETCH AUTO COMMAND VALUE 

BEQ 

MOV 

MOV ( RO 1 + ,R2 ;FETCH INSTRUCTION CODE 

MOV Rl,CHARS(RZ) ;DEPOSIT COMMAND VALUE WHERE REQUIRED 

MOV RO ,COW ;UPDATE COMMAND POINTER 

BR NOAUTO ;DONE HERE 

BR NOAUTO ;DONE HERE 

MOV (COMMAN+2),RO ;RESTORE COMMAND POINTER 

MOV RO , COMMAN ; 

.ENDM PREPRG 

i 

AUTCOM: DEC CHARS+(2*134) ;DECREMENT DELAY COUNTER 

; 

AUTEND: DEX CHARS+(2*107) ;DECREMENT (CLEAR) AUTO COMMAND FLAG 

NOAUTO : 

; 

i 

i 

.............................................................................. 

; LOOP RATE INDICATOR FLIP/FLOP ROUTINE 

i Preset VALUE 13 passed to specified D/A CHA"e1 

.-___-------------__---------------------------------------------------

v 

i 

.MACRO FLPFLP CHANN,VALUE 

MOV #<VALUE+4OOO),@$<OuT+(C~N*2)) ;OUTPUT VALUE TO D/A 

.ENDM FLPFLP 

; 

i 

.............................................................................. 

;DIGITAL INPUT PORT SCAN FOR POSITION DATA 

i Input port assignments as follows: 

i Bits Port Channel Sensor 

; 0-9 A 1- AL 

; 10-15 + A 

; 0-3 B 2 Ax 

; 4-13 B 3 AU 

i 14-15 + B 

59 
0-7 C 4 Fu 

8-15 + C 

0-1 D 5 FL 

i 

i 

.MACRO DIGSCN 

MOV @#DBRA,R3 

MOV . @#DBRB,R2 

B9EBRC ,R1 unr i 

MOV @#DBRD, RO AlVV 

; 

i 

;DISASSEMBLE FOR INDIVIDUAL CHANNELS 

MOV R3 ,R4 

BIC #176000,R4 

MOV R4 ,AL 

MOV R3 ,R5 

MOV €22 ,R4 

BIC #176000,R5 

MOV R5 ,AX 

i 

ASHC #-lo. ,R4 

i 

i 

i 

MOV R2 ,R4 

ASH #-4. ,R4 

BIC #176000,R4 

MOV R4 ,AU 

MOV R2 ,R5 

MOV R1 ,R4 

ASHC #-14. ,R4 

BIC 8176000,RS 

MOV R5 ,Fu 

MOV RO .R4 

MOV R1 ,R5 

ASHC #-8.,R4 

BIC #176000,R5 

MOV R5 ,FL 

.ENDM DIGSCN 

;F"CH DIGITAL INPUT PORT DATA 

i 

; 

I 

;COPY PORT A 

;MASK HIGH BITS 

; 

;COPY PORT A 

;AND PORT B 

;JUSTIFY DATA 

;MASK HIGH BITS 

i 

;COPY PORT B 

;JUSTIFY DATA 

;MASK HIGH BITS 

; 

;COPY PORT B 

;AND PORT C 

;JUSTIFY DATA 

;MASK HIGH BITS 

i 

;COPY PORT D 

;AND PORT C 

;JUSTIFY DATA 

;MASK HIGH BITS 

; 
CONFIG. MAC 

~*****************&***************~******************************************* 

; 

; THE MACRO ROUTINES CONTAINED IN THIS LIBRARY ARE AS FOLLOWS : 

i 

; CONFIG SYSTEM 1/0 ADDRESS CONFIGURATION 

; DFCHAR CHARS ARRAY DEFINITIONS 

; 

.............................................................................. 

.............................................................................. 

;SYSTEM CONFIGURATION - Defines all hardware addresses, vectors etc. No 

; run-time content 

;-------------------------------------------------

; 

i 

; 

.MACRO CONFIG 

; PROGRAMMABLE CLOCKS 

CL1S=170400 

CLlB=CLlS+2 

CLlV=440 

CL2S-170420 

CL2B=CL2S+2 

CL2V-4 50 

i 

; A/D CONVERTE3S 

; 

; 

ADlSR=170430 

ADlBR=ADlSR+2 

AD2SR=170440 

ADZBR=AD2SR+2 

; 

; 

; 

; D/A CONVERTERS 

OUT= 170450 

; 

; 

; DIGITAL 110 PORTS 

CSRA-164160 

DBRA = CSRA+ 2 

CSRB=CSRA+4 

DBRB=CSRA+6 

CSRC=CSRA+lO 

DBRC=CSRA+12 

csRD=csRA+14 

DBRD=CSRA+16 

; 

; KEXBOARDICRT 

; 

TKS= 17 7560 

TKB=TKS+2 

TPs=TKs+4 

TPB=TKS+6 

; 

; 

; 

; SYSTEM F'UNCTIONS 

LCLKs177546 

;CLOCK 1 

;CLOCK 1 

;CLOCK 1 

;CLOCK 2 

;CLOCK 2 

;CLOCK 2 

STATUS REGISTER 

BUFFER/PRESET RECISTER 

INTERRUPT VECTOR 

STATUS REGISTER 

BUFFER/PRESEI: REGISTER 

INTERRUPT VECTOR 

;AID BOARD 1 STATUS REGISTER 

;AID BOARD 1 DATA/BUFFER REGISTER 

;AID BOARD 2 STATUS RM;ISTER 

;AID BOARD 2 DATA/BUFFER FEGISTER 

;FIRST D/A PORT (CHANNEL 0, BOARD 

;FOLLOWING CHANNELS IN INCREMEIQS 

;LAST CHANNEL IS 13 (OCTAL, BOARD 

;PORT A STATUS RESISTER 

;PORT A DATAIBUFFER REGISTER 

;PORT B STATUS 

;PORT B DATA 

;PORT C STATUS 

;PORT C DATA 

;PORT D STATUS 

;PORT D DATA 

;KEYBOARD STATUS REGISTER 

;KEYBOARD DATAIBUFFER REGISTER 

;CRT STATUS REGISTER 

;CRT DATAIBUFFER REGISTER 

;SYSTEM (LINE FREQUENCY) CLOCK 

1) 

OF 2 

31, =170476 

61 
PSW1177776 ;PROCESSOR STATUS WORD 

.E" CONFIG 

i 

i 

.............................................................................. 

;CHARS ARRAY DEFINITIONS - Sets default assignments of key variables to CHARS 

i array locations. All are GLOBAL references 

3 

i 

; POSITIONS/ATTITUDES 

.---------------------------------------------------------------

.HACRO DJXHAR 

L 

i 

AXIAL==:CHARS+14 

UT== :CHARS+16 

VERT== :CmS+20 

PITCH==: CHARS+24 

YAW==:CHARS+26 

i 

; LOOP GAINS 

; 

AG--:CHARS+102 

LG==rCHARS+104 

VG==:CHARS+106 

PG==:ccHARs+112 

YG==:CHARS+114 

; 

; POSITIONS SENSORS 

i 

AL==:cHARs 

Ax== : cHARs+2 

AU==:CHARS+4 

FU== : CHARS+6 

FL== : CHARS+lO 

; 

; PROGRAM SWITCHES 

; 

DATFLG==:CHARS+<2*73) 

OVRFLW==:CHARS+<2*17> 

OUTFLG==:CHARS+(2*75) 

I"LG==:CHARS+(2*110) 

DRGFZG== : CHARS+( 2*50 > 

AUTFLG-=:CHARS+(2k107) 

AUTNUM=*:CHARS+<2k47) 

; 

; 

i 

; MISCELLANEOUS 

OSC==:CHARS+<2k136) 

.ENDM DFCHAR 

;AXIAL POSITION 

;LATERAL POSITION 

;VERTICAL POSITION 

;PITCH ATTITUDE 

;YAW ATTITUDE 

;AXIAL GAIN 

;LATERAL GAIN 

;VERTICAL GAIN 

;PITCH GAIN 

;YAW GAIN 

;POSITION SENSOR SIGNALS 

;AL=A€T LEFT, 

;F'U=FORHAFU) UPPER, 

;EX. 

; 

;DATA ACQUISITION FLAG ( "1 'I1 

;DATA OVERF'LOW FLAG ( I' / I' 1 

;OUTPUT ON/OFF FLAG ("3") 

;HAIN INTEGRATOR FLAG ("h") 

;DRAG INTMSRATOR FLAG ("H") 

;AUTO ROUTINE FLAG ("g") 

;AUTO ROUTINE NUMBER ("G") 

#OSCILLATOR MASTER COUNTER ( "*'I 1 

62 
APPENDIX C -PDP 11/23 SYSTEM CONFIGURATION 

CPU - PDP 11/23 PLUS with FPFll floating point processor 

Operating system - RTll V5.0 

Languages - FORTRAN V2.6, MACRO V5.0 

User 1/0 devices - VT102 CRT, LA100 printer, HP7475 plotter 

Real-time 1/0 - 16/32 A/D channels (differential/single ended) 

12 D/A channels 

64 digital 1/0 lines 

Clocks - 2 programmable 

Serial 1/0 - 6 lines (console, printer, plotter, 3 spare) 

Memory - 256kB (only 56kB normally available for real-time 

software) 

SYSTEM CONFIGURATION and MODULE SPECIFICATION ................................................................. 

SYSTEM SERIAL NUMBER - BT02952 DEC - 84065849X ................................................................. 

11/23 BE - System box 

Module E tch/rev Function Address Vector 

M8189 C A 11/23 CPU 

M8188 C C FPF-11 floating point 

M8067 C A MSVll memory 

M8061 C C RLV22 disk controller 

M8377 KXT11-C processor 160100 

M4002 J M KWV11-C clock 170400 440 

M4002 KWV11-C clock 170420 450 

M8043 E M DLV11-J serial 1/0 176500 300 

510 310 

520 320 

530 330 

................................................................. 

................................................................. 

M9404 Bus extender 

BA11-SE expansion box 

M9405 Bus extender 

A8000 E H ADV11-C A/D 170430 400 

A8000 ADV11-C A/D 170440 420 

A6006 E F AAV11-C D/A 170450 

A6006 E F AAVll-C D/A 460 

A6006 AAV11-C D/A 470 

M8049 DRV11-J Digital 1/0 164160 Prog. 

................................................................. 

................................................................. 

63 
Serial line baud rates are: 

RTll unit 1 Console 9600 

Printer 9600 

2 SLUl 300 

3 SLU2 (plotter) 9600 

4 SLU3 9600 

5 SLU4 9600 

64 
APPENDIX D 

Individual hardware subsystems can be tested and exercised 

to some degree without the MSBS operating and without the 

controller software running. Such procedures are frequently 

necessary for isolation of hardware or software malfunctions. 

Position sensors 

11TSTDI018 scans the digital input ports and decodes the input 

data to position sensor counts, following the same procedures 

documented in the controller module 18CNTRLB11 (APPENDIX 2). The 

position sensor I8backupl8 clock or the computer clock must be 

running in order to generate valid sensor outputs. 88TSTDI018 does 

not start or stop the computer clocks. 

The Figure shows 

the normal allocation 

of position sensor 

channels : 

1 - Aft lateral (AL) 

2 - Axial (AX) 

3 - Aft upper (AU) 

4 - Forward upper (FU) 

5 - Forward lateral (FL) 

Vert tcal (boamm) 

Drag 

I amor 

Fia.A.1 Position sensor channel allocation 

65 
Current monitors 

"TSTADl" and I1TSTAD2l1 scan all input channels to A/D boards 

1 and 2 respectively. The usual channel assignments (see Section 

3) are summarized below: 

Board Computer channel External channel Function ................................................................. 

1 0 1 Drag current 

1 2 Bias 1 

2 3 Bias 2 

3 4 Bias 3 

a J Bias 4 

5 6 Control 1 

6 7 Control 2 

7 8 Control 3 

2 0 9 Control 4 

c 

The numbering sequence for electromagnets is shown below. A/D 

voltage ranges are liable to be changed between 0 to +1OV and 

-lOV to +1OV. Consult PDP-11 system documentation for further 

details. 

X 

Electromagnet numbering sequence 

Power supplies 

llTSTOUT1l can be used to set the D/A outputs to any desired 

steady-state level, thereby commanding steady currents from the 

66 
(Control) electromagnet power supplies. Normai channel 

assignments are shown below : 

1 0 1 

1 2 

2 3 

3 4 

(2) 4 (sequential) (or 0) 5 

Control 1 

Control 2 

Control 3 

Control 4 

Drag 

The D/A converters will normally be set to the following ranges: 

Counts Range point Nominal voltage .................................................. 

0 +Full scale +lo v 

4000 ov ov 

7777 -Full scale -10 v 

67 
TSTDIO.FOR 

C***************~*******~~~******************************************~***~***~ 

C PROGRAM TO SWEEP TEST HSBS POSITION SENSOR DIGITAL CHANNELS 

C***********************~********************~*******************************~ 

C 

C SCANS DIGITAL INPUT PORTS ASYNCHRONOUSLY, DECODES TO POSITION SENSOR COUNTS 

C OUTPUT IS POSITION SENSOR COUNTS (DECIMAL) FOR SENSOR CHANNELS 1-5 IN 

C COLUMNS 1-5. 

C 

C ** WARNING ** ASYNCHRONOUS SCAN TECHNIQUE CAN GIVE INVALID DATA DURING 

C INPUT PORT UPDATING. A 

L 

DIMENSION IDATA( 5 1 

TYPE 10 

10 FORMAT(' DIGITAL INPUT (POSITION SENSOR) SWEEP TEST') 

TYPE 20 

20 FORMAT( ' NUMBER OF SWEEPS? ' 1 

READ(S,*) NSWEP 

50 DO 30 I=l,NSWEP 

CALL DIOTST( IMTA) 

30 TYPE QO,(IDATA(J),J=l,S) 

40 FORMAT( 518 1 

PAUSE 

GO TO 50 

STOP 

END 

68 
DIOTST. MAC 

. 

i 

; 

DIOTST : 

; 

.TITLE DIOTST 

Input port assignments as follows: 

Bits - 0-9 

10-15 + 

0-3 

4-13 

14-15 + 

0-7 

8-15 + 

0-1 

.GLOBL DIOTST 

CSRA=164160 

DBRA=CSRA+Z 

CSRB=CSRA+4 

DBRB=CSRA+6 

CSRC=CSRA+lO 

DBRC=CSRA+12 

csRD=csRA+14 

DBRD=CSRA+16 

CLS=170420 

CLB=CLS+2 

TST (R5)+ 

MOV (RS)+,DATA 

Port Channel Sensor 

A 1 AL 

A 

B 2 Ax 

B 3 AU 

B 

C 4 Fu " L 

D 5 F-L 

MOV @#DBRA ,R3 

MOV @#DBRB , R2 

MOV @#DBRC,Rl 

MOV @#DBRD , RO 

;DISASSEMBLE FOR INDIVIDUAL CHANNELS 

; 

MOV 

BIC 

MOV 

ADD 

MOV 

MOV 

ASHC 

BIC 

MOV 

ADD 

i 

MOV 

ASH 

B IC 

MOV 

ADD 

MOV 

MOV 

ASHC 

BIC 

MOV 

R3 ,R4 

#176000,R4 

R4 ,@DATA 

#2 ,DATA 

R3 ,R5 

R2 ,R4 

#-lo. ,R4 

#176000,R5 

R5, @DATA 

#2, DATA 

R2 ,R4 

#-4. ,R4 

#176000,R4 

R4, @DATA 

#2, DATA 

R2 ,R5 

R1 ,R4 

#-14. ,R4 

t176000,RS 

R5, @DATA 

;DIGITAL PORT A STATUS 

;PORT A DATA BUFFER 

;PORT B STATUS 

;Em. 

;CLOCK N0.2 STATUS REGISTER 

;CLOCK N0.2 BUFFER REZISTER 

;SKIP ARGUMENT COUNT 

;SAVE ARRAY ADDRESS FOR DATA RETUFtN 

;FFTCH DIGITAL INPUT PORT DATA 

; 

; 

; 

;COPY PORT A 

;MASK HIGH BITS 

; STORE 

;INCREMENT STORE ADDRESS 

;COPY PORT A 

;AND PORT B 

;JUSTIFY DATA 

;MASK HIGH BITS 

;STORE 

;INCRPIENT STORE ADDRESS 

;COPY PORT B 

;JUSTIFY DATA 

;MASK HIGH BITS 

; STORE 

;INCREMENT STORE ADDRESS 

;COPY PORT B 

;AND PORT C 

;JUSTIFY DATA 

;MASK HIGH BITS 

; STORE 

69 
t 

ADD 

MOV 

ASHC 

BIC 

NOV 

ADD 

nov 

i 

i 

I 

m 

MTA: .WORD 

.END 

#2 ,DATA 

RO ,R4 

R1 ,R5 

#-8. ,R4 

#176000,RS 

RS , @DATA 

#2 ,DATA 

PC 

0 

;INCRPiElYT STORE ADDRE3S 

;COPY PORT D 

;AND PORT C 

;JUSTIFY DATA 

;MASK HIGH BITS 

; STORE 

;IN- STORE ADDRESS 

;GO TO FORELA-! 

;DATA ARRAY ADDRESS STORAGE 
TSTAD1.FOR 

. 

CI**~*****************************~*************************~***************** 

C PROGRAM TO SbSEEP TEST AID CONVERTER BOARD 1 

C****************~********~**********************************************~**** 

C 

C REPFTITIVELY SCANS ALL (8) CHANNELS OF AID BOARD 1 IN OCTAL OR DECIMAL FORM 

C REQUEsTED CYCLES OVER 1000 CAUSES CONTINUOUS SWEEPING UNTIL (CONTR0L)C 

C OUTPUT IS DATA FROM CHA"ELS 0-7 IN COLUMNS 1-8 n L 

10 

20 

24 

2s 

C 

C OCTAL 

C 

100 

30 

40 

50 

60 

C 

DIMENSION IDATA( 16) 

TYPE 10 

FORMAT(' A/D BOARD 1 SB TEST') 

TYPE 20 

FORMAT(/' NUMBER OF CYCLES? 01000 CONTINUOUS)') 

READ(5,*) ICYCLE 

TYPE 25 

FORMAT(' OCTAL(O), OR DECIW(1) OUTPUT?') 

READ (5,*) IDUMMY 

IF (IDUHMY) 24,100,200 

OUTPUT 

JCYCLE= 1 

DO 40 ICHA"=0,7 

CALL ADlTST(ICHA",IDATA(ICHA"+l)) 

TYPE SO,(IDATA(J),J=1,8) 

FORMAT(808) 

IF (JCYCLE.GT.ICYCLE) GO TO 60 

JCYCLE=JCYCLE+l 

GO TO 30 

IF (ICYCLE.GT.1000) GO TO 30 

PAUSE 

GO TO 100 

C DECIMAL OUTPUT 

C 

200 

130 

140 

150 

160 

JCYCLE=l 

DO 140 ICHA"=0,7 

CALL ADlTST(IC"N,IMTA(IC~N+l)) 

TYPE lSO,(IDATA(J),J=l,B) 

FORMAT( 817 1 

IF (JCYCLE.GT.ICYCLE) GO TO 160 

JCYCLE=JCYCLE+l 

GO TO 130 

IF (ICYCLE.GT.1000) GO TO 130 

PAUSE 

GO TO 200 

END 

71 
ADlTST .MAC 

.TITLE ADlTST 

.GLOBL ADlTST 

ADSRo 170430 

ADBR=ADSR+2 

i 

; 

; 

ADlTST: TST 

MOV 

ASH 

BIS 

nov 

nov 

nov 

; 

i 

TEST: TSTB 

BPL 

TST 

MOV 

nov 

RTS 

8 

; 

CHANN: .WORD 

DATA: .WORD 

$ 

.END 

(R51+ 

( R5 1 + , CHANN 

( R5 1 + ,DATA 

@C"N , RO 

We. ,RO 

$1 ,RO 

RO , @#ADSR 

WADSR 

TE3T 

RO 

WADBR ,RO 

RO ,@DATA 

Pc 

0 

0 

;PROGRAH TITLE 

;GLOBAL SYMBOL 

;DEFINE AID COMMUNICATIONS 

; PORTS 

;SKIP ARGUMENT COUNT 

;GET ADDRESS OF CHANNEL NUMBER (0-15) 

iSAW ADDRF-SS I;ncmIO# FCR EAn EEE"ES 

;FETCH CHANNEL "BER 

zSHIFT NUMBER TO BITS 8-11 

;SET GAIN (1) AND START BIT 

;SFT UP CHANNEL AND GAIN 

;IS A/D WWE? 

;WAIT IF NOT 

;DUMMY WAIT 

$FETCH DATA 

;AND STORE 

;GO BACK TO FORTRAN 

;CHANNEL NUMBER 

;RETURNED DATA 

72 
TSTAD2.FOR 

CI**II****************************~******************************************* 

C PROGRAM TO SWEEP TEST AID CONVERTER BOARD 2 

C******&********~*****************~~********************************~*******&* 

C 

C REPGTITIVELY SCANS ALL (8) CHANNELS OF A/D BOARD 2 IN OCTAL OR DEI- FORN 

C REQUESTED CYCLES OVER 1000 CAUSE3 CONTINUOUS SWEEPING UNTIL <CONTROL>C 

C OUTPUT IS DATA FROM CHANNELS 0-7 IS COLUMNS 1-8 

C 

10 

20 

24 

25 

C 

c OCTAL 

C 

100 

30 

40 

50 

60 

C 

DIMENSION IDATA(16) 

TYPE 10 

FORMAT(' A/D BOARD 2 SWEEP TEST') 

TYPE 20 

FORMAT(/' NUMBER OF CYCLES? 01000 CONTINUOUS)') 

READ(5.*) ICYCLE ~~ 

TYPE 25 

FORMAT( ' OCTAL(O), OR DEIMAL(1) OUTPUT?' 1 

READ (5,*) IDUMMY 

IF (IDUMMY) 24,100,200 

OUTPUT 

JCYCLE=l 

DO 40 ICHA"=0,7 

TYPE SO,(IDATA(J),J=1,8) 

FORMAT( 808 1 

IF (JCYCLE.GT.ICYCLE) GO TO 60 

JCYCLE=JCYCLE+l 

GO TO 30 

IF (ICYCLE.GT.1000) GO TO 30 

PAUSE 

GO TO 100 

CALL AD2TST(ICHANN,IDATA(ICHA"+l)) 

C DECIMAL OUTPUT 

C 

200 JCYCLE= 1 

130 DO 140 ICHANN=0,7 

140 CALL ADZTST(ICHA",IDATA(ICHANN+l)) 

TYPE lSO,(IDATA(J),J=1,8) 

IF (JCYCLE.GT.ICYCLE) GO TO 160 

JCYCLE=JCYCLE+l 

GO TO 130 

PAUSE 

GO TO 200 

END 

150 FORMAT( 817 1 

160 IF (ICYCLE.GT.1000) GO TO 130 

. 

73 
AD2TST. MAC 

.TITLE AD2TST 

.GLOBL ADZTST 

ADSR1170440 

ADBR=ADSR+2 

; 

t 

; 

AD2TSTr TST 

MOV 

MOV 

MOV 

ASH 

BIS 

MOV 

i 

; 

TEST: TSTB 

BPL 

TST 

MOV 

RT3 

nov 

; 

; 

CHANN: .WORD 

DATA: .WORD 

.END 

; 

(R5)+ 

( R5 1 + ,CHA" 

( R5 1 + , DATA 

(PC"N,RO 

#8. ,RO 

$1 ,RO 

RO , B#ADSR 

(Q#ADSR 

TEST 

RO 

(P#ADEU4, RO 

RO , (PDATA 

Pc 

0 

0 

;PROGRAM TITLE 

;GLOBAL SYMBOL 

;DEFINE AID COMMUNICATIONS 

;PORTS 

;SKIP ARGUm COUNT 

;GE3' ADDRESS OF CHANNEL NUMBER (0-15) 

iSAVE ADDRESS LOCATION FOR DATA "URN 

;FETCH CHANNEL NUMBER 

;SHIFT NUMBER TO BITS 8-11 

;SET GAIN (1) AND START BIT 

;SGT UP CHANNEL AND GAIN 

;IS A/D DONE3 

;WAIT IF NOT 

;DUMMY WIT 

;FEXH DATA 

;AND STORE 

;GO BACK M FORTRAN 

;CHANNEL NUMBER 

;RETUNED DATA 

t 

c 

74 
TSTOUT.FOR 

CII********************************~****************************************** 

C PROGRAM TO TEST D/A CONVERTER FUNCTION 

C***************~******************~***&******************~******************* 

C 

C 

C 

C 

C 

C 

C 

C 

C 

C 

C 

C 

C 

TAKES (DECIMAL) CHANNEL NUMBER AND (OCTAL OR VOLTAGE) DATA AND SETS 

RELEVANT D/A CHANNEL. PRESENT VALID CHANNEL NUMBERS ARE 0-11, VALID DATA 

IS FROM 0-7777 (OCTAL). OR -10 TO +10 (VOLTS) 

0 = +FULL SCALE (9.9951V) 

4000 = OV 

7777 = -FULL SCALE (-1OV) 

NEEATIVE CHANNEL NUMBER OR <CONTROL>C ABORT3 PROGRAM 

OUTPUT IS OLD (OCTAL) D/A PORT DATA, NEW (OCTAL) DATA, CHANNEL NUMBER 

(DECIMAL) AND NOMINAL D/A OUTPUT VOLTAGE 

100 TYPE 10 

10 FORMAT(' D/A SINGLE CHANNEL TEST'//,' SPECIFY OCTAL(0) OR VOLTS(1) 

20 TYPE 30 

30 FORMAT( 1' CHANNEX NUMBER (DECIMAL, 0-1113' 

1 INPUT') 

READ(S,*) IDUMMY 

READ(5,*) ICHA" 

IF(ICHANN.LT.0) GO TO 70 

IF(ICHANN.GT.11) GO TO 20 

IF (IDUMMY) 100,110,120 

C 

C OCTAL INPUT SECTION 

C 

110 TYPE 40 

40 FORMAT(' DATA (OCTAL, 0-7777)?') 

READ(5,50,ERR=20) IDATAZ 

50 FORMAT( 04) 

IF (IDATA2.LT.O.OR.IDATA2.GT.''7777) GO TO 110 

CALL OUTTST(ICHA",IDATAl,IDATA2) 

TYPE 6O,IDATA1,IDATA2,ICH,EQVOLT 

1 ' NOMINAL VOLTS=',F7.3) 

GO TO 20 

C 

C VOLTAGE INPUT SECTION 

C 

120 TYPE 130 

130 FORMAT(' DATA (VOLTAGE, -10 TO +lo)'?') 

EQVOLT=-1O.*(IDATA2-"4OOO)/FLOAT("3777) 

60 FORMAT(' OLD DATA=',O6,' NEW DATA=',06,' CHANNEL=',I4, 

READ(5,*) VOLTS 

IF (ABS(VOLTS).GT.lO) GO TO 120 

CALL OU'ITST(ICHA",IDATAl,IDATA2) 

TYPE 8O,IDATA1,IDATA2,ICHANN,VOLTS 

1 ' NOMINAL VOLTS=',F7.3) 

GO TO 20 

IDATA2~IFIX("4000-"3777*VOLTS*O.l~ 

80 FORMAT(' OLD DATA=',O6,' ,NEW DATA=',06,' CHANNEL*',I4, 

C 

C DONE 

C 

70 STOP 

END 

75 
OUTTST .MAC 

.TITLE OUTTST 

.GLOBL OUTTST 

MONI3=170450 

i 

; 

; 

OUTTST: TST 

MOV 

nov 

nov 

; 

MOV 

ML 

ADD 

nov 

nov 

nov 

; 

i 

3 

m 

C": .WORD 

MTAl: .WORD 

DATA2: .WORD 

; 

.END 

(RS)+ 

( R5 1 + , CHANN 

(RS)+,DATAl 

(RS)+,DATAZ 

(PCHANN , RO 

RO 

#DAONE,Rl 

R1 ,RO 

(RO),@DATAl 

ODATA2,(RO) 

PC 

0 

0 

0 

L 

76 

;PROGRAM TITLE 

;DECLARE GLOBAL SYMBOL 

;ADDRESS OF FIRST D/A CONVERTER 

;SAVE DATA ACROSS FORTRAN CALL 

;CHANNEL "BER 

;FOR OLD DATA 

;NEW DATA 

;FETCH CHANNEL NUMBER 

;CONVERT TO CHANNEL ADDRESS INcRplENTS 

IFETCH BASE ADDRESS 

;ADD BASE 

;F" THE D/A BUFFER CONTENTS 

$WRITE IN THE VALUE 

;GO BACK TO FORTRAN 

iCHA"EL NUNBER 

;D/A BUFF'ER DATA BEFORE WRITE 

;NEW D/A BUFFER DATA 
REFERENCES 

1. Goodyer, M.J.: The Magnetic Suspension of Wind Tunnel Models 

for Dynamic Testing. University of Southampton, Department 

of Aeronautics and Astronautics PhD Thesis, April 1968. 

2. Luh, P.B:, Covert, E.E., Whitaker, H.P. Haldeman, C.W.: 

Application of Digital Control to a Magnetic Suspension and 

Balance System. NASA CR-145316, January 1978. 

3. Fortescue, P.W., Bouchalis, C.: Digital Controllers for the 

Vertical Channels of a Magnetic Suspension System. NASA CR165684, May 1981. 

4. Britcher, C.P.: The Southampton University Magnetic 

Suspension and Balance System - A Partial User Guide. 

Southampton University Department of Aeronautics and 

Astronautics AASU Tech. Memo 83/8, April 1984. 

5. Britcher, C.P., Fortescue, P.W., Allcock, G.A., Goodyer, 

M.J.: Investigation of Design Philosophies and Features 

Applicable to Large Magnetic Suspension and Balance Systems. 

NASA CR-162433, November 1979. 

6. Britcher, C.P.: Some Aspects of Wind Tunnel Magnetic 

Suspension and Balance Systems with Special Application at 

Large Physical Scales. NASA CR-172154, September 1983. 

7. LaFleur, S.S.: Advanced Optical Position Sensors for 

Magnetically Suspended Wind Tunnel Models. 11th ICIASF 

Conference, Stanford, August 1985. 

77 
1. Report No. I 2. Government Accerrion NO. I 3. RRipient’r catalog No. 

NASA CR-178210 I 

4. Title and Subtitle 

User Guide for the Digital Control System of the NASA/ 

Langley Research Center’s 13-inch Magnetic Suspension 

5. Report Date 

March 1987 

6. Partorming Organization CoQ 

and Balance System 

7 Author(s1 

Colin P. Britcher 

9. Performing Organization Name and Address 

Old Dominion University 

Department of Mechanical Engineering and Mechanics 

Norfolk, VA 23508 

I2 Sponsoring Ayency Name and Address 

National Aeronautics and Space Administration 

Washington, DC 20546 

~ 

17. Key Words (Suggested by Author(rJ I I 18. Distribution Statement 

8. Performing Organization Report NO. 

10. Work Unit No. 

11. Contract or Grant No. 

NAS1-17993, Task 24 

13. Type of Report and Period Coverad 

Contractor Report 

14. Sponsoring Agtncy Code 

505-61-01-02 

Magnetic Suspension 

Digital Control 

Wind Tunnels 

19. Security aauif. (of thts report) 20. Security Clauif. [of this page) 21. No. of Pages 

Unclassified Unclassified 79 

Unclassified - Unlimited 

Subject Category - 09 

- 

22. Price 

A0 5