Ohio University

Avionics Engineering Center College of Engineering and Technology Stocker Center Ohio University 131hens. Ohio 45701-2979

ADDENDUM TO MASTER'S THESIS

Ref: Master's Thesis, "Comparison of Great Circle and Rhumb Line Flight Paths in the Continental United States using Simulation and Flight Tests", Rajan Kaul, Department of Electrical and Computer Engineering, Ohio University, November 1984.

Ref: NASA Technical Memorandum 93, "Comparison of Great Circle and Rhumb Line Flight Paths in the Continental United States using Simulation and Flight Tests", by Rajan Kaul, November 1984.

In his thesis, Mr. Kaul refers to airways defined by VHF Omnirange stations (VORs) as rhumb-line paths. He goes on to compare these constant-heading flight paths with great-circle navigation, which provides guidance along the shortest line between two geodetic points.

While Mr. Kaul is correct in his comparison and his conclusion that great-circle flying will save and fuel compared with rhumb-line navigation between the same two points, the reader may derive an incorrect impression. The radials defined by a VOR station are, in fact, great circles. FAA charts show these radials as constant-heading courses, which is correct in practice only because the course between VOR stations is a very short segment of the great-circle path between the VORs. If the pilot were able to follow the VOR radial for a very long distance, he would find that he would have to vary heading slightly to maintain an on-course indication on his VOR instrument.

The flight measurements performed for this work were referenced to the Henderson (HNN) VOR as a visual reference point, and one from which radial information could be recorded. The flight path was, in fact, a constant heading path.

Mr. Kaul refers in several places to impact on the Air Traffic Control (ATC) System from pilots using long-range, great-circle systems to navigate in the presently-defined airways structure. This impact takes two forms:

1. Using any second navigation system to fly between geodetic points also defined by the presence of VOR stations may result in errors, simply because the second system will always evidence offsets in geometry (and thus fix positioning accuracy), compared to the first. The Loran-C system, for example, while very stable and predictable, is affected by local ground conductivity and other factors which introduce geodetic error. The resulting offsets complicate ATC's task of tracking and separating aircraft flying against two references (although in fact, the risk of mid-air collision quite probably is DECREASED I ) . 2. For long trips, a user navigating "direct" between two points without reference to the intervening VOR positions, may deviate considerably from the established airway structure. While this also reduces collision risk, it may carry the pilot near high terrain or obstructions which are avoided by the VOR-defined airways. Again, ATC functions may be made more complicated.

It was clear from Mr. Kaul's oral thesis defense that he understood these points. His writing (and my reviews) may have resulted in some confusion for the thesis reader.

Robert W. Lilley, Ph. D., advisor July, 1989 1 COMPARISON OF GREAT CIRCLE AND RHUMB LINE FLIGHT PATHS

IN THE CONTINENTAL UNITED STATES USING

SIMULATION AND FLIGHT TESTS,

A Thesis Presented to

The Faculty of the College of Engineering and Technology

Ohio University

In Partial Fulfillment of

the Requirements for the Degree

Master of

by

Ra j an Kaul 2 "- November, 1984 TABLE OF CONTENTS

PAGE

List of Figures. iii

List of Tables.

I. INTRODUCTION AND SUMMAKY 11. PROBLEM DESCRIPTION

A. Description of Navigation Systems 1. VOR/DME Navigation System 2. Loran-C Navigation 3. Omega Navigation 4. Inertial Navigation System 5. Global Positioning System

B. . Great Circle and Rhumb Line Navigation C. Magnetic Variation D. Goals of Research

111. PATH DISCREPANCIES

A. Great Circle and Rhumb Line Paths B. Magnitude of Discrepancies C. Mathematical Model D. Software Model IV . MAGNETIC VARIATION A. Background B. Mathematical Model C. Results of FORTRAN Simulation

V. SYSTEM DESCRIPTION

A. Hardware Description B. Navigation Programs C. Rhumb Line and Magnetic Variation Software D. ACIA Input Software

A. Simulation of Great Circle and Rhumb Line Paths B. Flight Tests C. Tests of Hagnetic Variation Implementation

VII. CONCLUSIONS TABLE OF CONTENTS (CONTINUED)

PAGE

VIII. ACKNOWLEDGEMENTS 97

IX. REFERENCES 98

X. APPENDICES A. FORTRAN Listing of program to Compute Errors 101 Between Great Circle and Rhumb Line Paths. B. FORTRAN Listing of MAGVAR Program. 105 C. Coefficients for the 5 Bands and Secular 109 Variation Used by MAGVAR. D. Assembly Language Listing of RLCALC. 112 E. Assembly Language Listing of CDUINP. 135 LIST OF FIGUKES

PAGE

Figure 2-1 VOR Navigation System (Source [18]) 6

Figure 2-2 Loran-C Transmitted Signal Format (Source [30]) 8

Figure 2-3 TDs Received From Master-Secondary Pairs (Source [36 1 )

Figure 2-4 Loran-C Coverage in the Northern Hemisphere 11 (Source [36])

Figure 2-5 Loran-C Coverage in the United States (Source [5]) 12

Figure 2-6 Omega Navigation System (Source [ 181 ) 14

Figure 2-7 GPS Navigation System (Source [18]) 15

Figure 3-1 Great Circles on the Surface of the Earth (Source 1141)

Figure 3-2 Rhumb Line on the Surface of the Earth (Source [14] )

Figure 3-3 Great Circle and Rhumb Line on a Mercator Projection (Source [14] )

Figure 3-4 Great Circle and Rhumb Line on the Surface of 25 the Earth (Source [14])

Figure 3-5 Lateral Separation between Great Circle and 29 Rhumb Line Path

Figure 3-6 Rhumb Line Cross Track Error 32

Figure 3-7 Great Circle Cross Track Error 34

Figure 4-1 Magnetic Variation in Continental U.S. (FORTRAN 4 1 Simulation)

Figure 4-2 Magnetic Variation in Continental U.S. From 42 World Declination Charts

Figure 5-1 Block Diagram of Ohio University Loran-C Receiver 46

Figure 5-2 Instruction Set of Mostek 6502 Microprocessor 49

Figure 5-3 Instruction Set of Am 9511 Arithmetic Processor 51

Figure 5-4 Block Diagram of the Micro-Computer System 52 LIST OF FIGURES (CONTINUED)

PAGE

Figure 5-5 Flow Charts of Interface Subroutines for Am 9511 (Source [36])

Figure 5-6 Flow Chart of RNAV Program (Source [18])

Figure 5-7 Flow Chart of RLCALC Program

Figure 5-8 Logical Steps of How Am 9511 Executes an Arithmetic Operation

Figure 5-9 Flow Chart of MGVAR Program

Figure 5-10 Flow Chart of CDUINP Program

Figure 6-1 Great Circle vs. Rhumb Line

Figure 6-2 Great Circle vs. Rhumb Line

Figure 6-3 Great Circle vs. Rhumb Line

Figure 6-4 Great Circle vs. Rhumb Line

Figure 6-5 Great Circle vs. Rhumb Line

Figure 6-6 Great Circle vs. Rhumb Line

Figure 6-7 Great Circle vs. Rhumb Line

Figure 6-8 Great Circle vs. Rhumb Line

Figure 6-9 Great Circle vs. Rhumb Line

Figure 6-10 Track Error vs. Trip Length at Average Relative Bearing 76"

Figure 6-11 Track Error vs. Trip Length at Average Relative Bearing 52'

Figure 6-12 Track Error vs. Trip Length at Average Relative Bearing 40"

Figure 6-13 Track Error vs. Trip Length at Average Relative Bearing 18"

Figure 6-14 Path of Flight Test 1

Figure 6- 15 Path of Flight Test 2 LIST OF TABLES

PAGE

Table 4-1 Limits on Five Bands and East Normalizing Factor

Table 4-2 Comparisons between Actual and Computed Values 4 3 of Magnetic Variation

Table 6-1 Cornparision of Cross Track Errors for Flight 90 Test 1

Table 6-2 Comparision of Cross Track Errors for Flight 91 Test 2

Table 6-3 Magnetic Variation Tests Using Loran-C Simulator 93 INTRODUCTION AND SUMMARY

The VOR/DME (VHF Omni-directional Range/Distance Measuring

Equipment) system is the short-range navigation system that provides a radial heading and a distance from the airborne receiver to a ground station. This rho-theta system of navigation is the basis for defining the airways in the National Airspace System (NAS). The air- ways follow paths of constant meridian crossing angle, also referred to as rhumb-line paths. The radial heading provided by the rho-theta system is a magnetic heading, affected by the position of the magnetic north pole relative to the geographic pole.

Modern position-fixing based receivers have the ability to com- pute great-circle courses. This is an attractive feature since it can provide direct routing of an aircraft from an origin to a destination point. The route structures, computed by position-fixing systems, are based on latitude and longitude, referenced to the geographic coor- dinate system.

The discrepancies between the route structures provided by the two systems may affect the current airway structure, or require restrictions on system use. This study quantizes the discrepancies between the great-circle and rhumb-line paths within the continental

United States.

In an effort to determine the magnitude of the discrepancies, a mathematical model that defines the two types of flight paths was developed for computer simulation. This simulation provides a data base for computation of the track errors between flight paths flown with great-circle or rhumb-line navigation. To verify the results com- puted by the model, an implementation in microcomputer machine language in a position-fixing receiver was tested in flight. A magne- tic variation model was included, which allowed the position-fixing receiver to compute magnetic bearing.

Comparison of results from the computer simulation and flight tests shows that the model does indeed provide an accurate data base to compute the discrepancies between the two flight paths. Evaluation of the results shows that althoug' " e discrepancies between the flight paths is significant for long routes (more than 500 nmi), the relative errors between great-circle and rhumb-line courses are within the current airway structure limits for typical routes of less than

200 -mi. 11. PROBLEM DESCRIPTION

The application of position-fixing navigation systems in the

National Airspace System (NAS) may result in mixed navigation methods in the airspace. The existing route structure based on the rho-theta concept will be combined with great-circle geometry. System user pre- ference for fuel and time-efficient great-circle 'direct' routes will be a concern.

A. Description of Navigation Systems

The growth in general aviation and commercial air traffic in the twenty years, and the anticipated evolution in the years ahead, has prompted extensive research in the navigation industry.

The ultima p goal of this research is to provide accurate navigation information to the pilot for enroute, terminal and approach segments of his flight. This has led to the development of a wide variety of position-fixing navigation systems including the Omega, Loran-C and the Inertial Navigation System. Also under development at is the satellite-based Global Positioning System (GPS).

Early navigation techniques depended upon pilotage and dead reckoning. Using a compass to determine magnetic heading and a knowledge of speed and time, the navigator could determine a position fix relative to the departure point [l]. It was not until later that the surge in air traffic prompted the need for more advanced naviga- tion systems. 1. vOR/DME Navigation System. Very Omni Range

(VOR) was developed in direct response to the growth in air traffic in the 1930s. With aircraft being flown at higher altitudes, the range of line-of-sight signals increased, allowing VHF signals to cover wider areas thus making VHF navigation practical.

VOR navigation is based on transmission of VUF signals from a ground station on frequencies between 108 and 118 MHz, [2] divided into channels spaced 50 kHz apart. The transmitted information con- tains two 30 Hz signals. One of these signals is a reference signal.

The second signal is received out of phase from the first, by an amount proportional to the magnetic bearing of the aircraft from the

VOR ground station.

Once received by the airborne receiver the signal is passed through an amplitude-modulation (AM) detector. The AM detector re- covers voice and identification signals, and channels them to the audio system of the aircraft. The two 30 Hz signals are isolated using filtering techniques and fed through a phase-comparison circuit.

The comparator provides the bearing of the aircraft to the VOR with respect to the magnetic north pole.

The VOR installation may also be equipped with Distance

Measuring Equipment (DME) which provides the distance from the aircraft to the ground station. The DME signals are transmitted from

1,025 to 1,150 MHz with channels spaced 1 MHz apart [3]. The airborne receiver thus provides magnetic heading and distance from the aircraft to the ground station (figure 2-1). The resulting VOR/DME station forms the International Civil Aviation Organization (ICAO) standard rho-theta short range navigation system [4].

The VOK receiver may be equipped with an area or random naviga- tion (RNAV) computer, which permits navigation to position fixes not located at a VOR/DME station. In effect the RNAV computer can "move" a physical vOR/DME station to a new location.

While the VOK/DME system satisfies most of the current naviga- tion requirements, it lacks certain notable capabilities. VHF limits the propagation of signals to line-of-sight, thus making it very dif- ficult for aircraft to receive signals in mountainous regions, or at low altitudes. Also more than 1000 stations need to be maintained to provide coverage in the United States. Loran-C is being considered as a possible supplement to the VOK/DME system.

2. Loran-C Navigation. Long Range Navigation (Loran-C) was developed in the 1950s when there was a need for long range marine navigation. The Loran-C system uses time differential measurement of the ground waves of (LF) signals. The system operates at 100 kHz. At LF the signals can propagate over long distances, pro- viding wider coverage with the use of fewer stations.

Three to five stations form a Loran-C chain, where the stations can be located more than 500 miles apart. Each chain consists of a master and two or more secondary stations. Each chain transmits "ORIDMEStation

P

VOR Indicator

Figure 2-1, VOR Navigation System groups of pulses at a specified rate called the Group Repetition

Interval (GRI) [5]. The master station transmits pulses in groups of

nine while the secondary stations, sometimes also referred to as slave

stations, transmit pulses in groups of eight. The pulses from each of

the secondary stations are delayed with respect to the master by a

certain time, referred to as the secondary coding delay. The secondary

coding delay ensures that no two signals from two different stations

reach any point in the chain coverage area at the same time. The GRI

is chosen for a particular chain to avoid interference from nearby

stations of a different chain. The GRIs range from 49,900 to 99,900 microseconds (ps) [6] .

The master signal contains 8 pulses spaced 1,000 ps apart and a

ninth pulse spaced 2,000 ps from the eighth pulse. The ninth pulse is

used for master identification and failure detection purposes. The

signals from the secondary stations contain just the 8 pulses spaced

1000 ps apart. The signals from a Loran-C chain are shown in figure

2-2.

The Loran-C receiver measures the time difference between the

arrival of one set of pulses with respect to another. The locus of

constant time differences defines hyperbolic lines-of-position (LOP).

The measurement of time differences (TDs) among signals received from

two stations, with respect to a third station, defines two LOPs. The

intersection of these LOPs indicates the position of the receiver

(figure 2-3). Many Loran-C receivers measure the TDs with respect to

Hyperbolic line between M and A

HyperboliclinebetweenMandB ---

Secondary B \ \

Figure 2-3. TDs Received From MmterSecondary Pain, the master station since it contains an extra pulse and can be iden-

tified easily.

The position determined from the LOPS can be translated into

geographic position provided the GRI and the locations of the stations

are known. This is possible using micropr.ocessor-based receivers to

make the computations relatively simple. Knowledge of the present

geographic position can determine range and bearing to a predefined

waypoint within the memory of the computer. Other navigation infor-

mation, such as cross track error from a particular course, ground

speed and estimated time of arrival, can also be computed. Most

Loran-C receivers on the market today use coordinate positioning com-

putations to provide navigation information.

Although Loran-C started primarily as an offshore navigation

system, advances in user equipment and the addition of more chains

have made it possible for the system to be used as an overland naviga-

tion system. However, operation is still dependent upon the availabi-

lity of signals and is restricted to certain areas. Figure 2-4 shows

the coverage of Loran-C signals in the northern hemisphere and figure

2-5 indicates the coverage in the United States.

3. Omega Navigation. Omega is a Very-Low-Frequency (VLF) hyperbolic navigation system. The VLF characteristic of the system allows nearly worldwide coverage with only 8 stations. The basic

principle behind Omega navigation is position determination by com-

paring phase difference of signals from at least three stations

13

(figure 2-6). All Omega stations transmit at four frequencies - 10.2,

11.05, 11.33, 13.6 kHz, and have a repetition period of 10 seconds

[7]. The eight Omega stations are located in Norway, Liberia, Hawaii,

North Dakota, La Reunion, Argentina, Japan and Australia.

4. Inertial Navigation System. Inertial Navigation System

(INS) is a completely self-contained navigation system. The system uses aircraft position displacement with respect to the initial posi- tion to compute an update to the current position [8]. Accelerometers and gyros are used to determine the accelerations of the aircraft.

The velocity vector can be computed by integrating the acceleration vector once, and the position displacement vector is computed by integrating the acceleration vector twice. This information is related to the previous or initial position to provide an update to the present position using an iterative process. Although the system is completely independent of outside signals, position updates can degrade as time elapses. A correction to the position estimate may be made using other navigational aids.

5. Global Positioning System. Global Positioning System (GPS) is an advanced satellite-based navigation system. Although still in the development stages, GPS is expected to provide highly accurate three-dimensional (latitude, longitude and altitude) position estima- tes using transit-time measurement of L-band signals from four satellites (figure 2-7). Three satellites are required to provide the position estimate, while the fourth satellite permits estimation of Omega Station Position A

Figure 2-6. Omega Navigation Sys tern Sate I li te 2

Sate I li te 3

Satellite 1

Aircraft

Figure 2-7. GPS Navigation System the error in the user [9]. The initial 18 satellite constella- tion is expected to provide all-weather worldwide coverage. It is being thought of as the complete navigation system of the and is expected to be operational by 1988 [lo].

B. Rhumb Line and Great Circle Navigation.

The standard rho-theta navigation procedure provides constant- heading flight paths along the radial of a VOK station. These paths are referred to as rhumb-line paths. Rhumb-line paths cross the geographic meridians at equal angles and appear as straight lines on a

Mercator projection. The VOR system, whether flown on radials to phy- sical VOKs or by reference to VOK RNAV computed courses, provides paths of constant heading to a point.

Area or Random navigation (RNAV) as defined in Federal Aviation

Administration (FAA) advisory circular 90-45A [ll] is:

'... a method of navigation that permits aircraft

operation on any desired course within the coverage

of the station referenced navigation signals or within

the limits of the self-contained system capabilities ....I

Omega, Loran-C, INS and GPS are considered RNAV systems. The unique feature of these RNAV systems is that they can all compute direct great circle paths between two points on the earth. A great- circle path is one that is formed by the intersection of the plane defined by the center of the earth and points of origin and destina- tion projected on the surface of the earth. The great-circle path

appears as a curved line on a Mercator projection and thus heading

changes constantly. It defines the shortest distance between two points on the earth.

The rhumb-line and the great-circle are two unique paths bet- ween any two points in the surface of the earth. The increasing cost of fuel has prompted a need to provide route structures that maximize

fuel efficiency. It would be economical for aircraft equipped with

position-fixing units to fly direct, great-circle paths without having

to report fixes with respect to VORs. Position-fixing receivers com-

pute great-circle paths under the assumption that the earth is a per-

fect sphere. Although a correction can be applied to account for the oblateness of the earth, a spherical approximation provides sufficient accuracy [12]. The scenario of concern is where one aircraft equipped with a VOR unit is flying a rhumb line path, while another aircraft equipped with position fixing navigation is flying a great-circle path. The discrepancies between the flight paths of the two aircraft may cause conflicts within the National Airspace System (NAS). It is of interest to quantize the discrepancies between the two paths and is

a subject of discussion in this report.

C. Magnetic Variation.

Another cause for conflict may arise because of the difference

in the magnetic variation across the continental United States.

Magnetic variation is the angle formed between the true meridian and the magnetic meridian at any point on the surface of the earth. The angle may differ by as much as 20 degrees in some parts of the U.S.

Position-fixing systems in use today are based on the geographic coor- dinate system referenced to the north and south poles. They provide true geographic heading to a waypoint and must be adjusted for magne- tic variation to enable a pilot to fly using a compass needle.

Although some avionics systems have the capability to compute magnetic variation from a data base in the computer memory, others call for user input to provide the variation. With that information, the system can provide a magnetic heading to the pilot. A simple implementation of magnetic variation for RNAV receivers will be discussed later in this study.

D. Goals of Research.

The principal objective of this research is to provide a mathe- matical model to compute discrepancies between the great-circle and rhumb-line paths, to implement the model in an RNAV receiver and to verify the results of the mathematical model in flight tests. Another goal is to provide a simple mathematical magnetic variation model [13] to be computed automatically by the receiver and adjusted to provide the correct magnetic heading to a particular waypoint, thus elimi- nating an extra item for pilot entry.

The Ohio University Loran-C receiver was chosen to achieve the goals and illustrate the results of this research. The receiver is based on a 6502 microprocessor to provide computer control. It was designed as a research tool and is extremely versatile. Changes and additions can be made easily; the receiver is very well suited to the requirements of this study, since data recording and display capabili- ties are available, and the receiver may be installed in available aircraft. 111. PATH DISCREPANCIES

A. Great Circle and Rhumb Line Paths.

To evaluate the path discrepancies between great-circle and rhumb-line routes it is vitally important to develop an understanding of the differences between the two paths in a physical sense. By definition, a great circle is one that is formed by the intersection of a plane that passes through the center of the earth and the surface of the earth [14]. This forms an arc when the plane also passes

through the origin and destination position fixes. A great-circle path, if extended in either direction, would circumscribe the entire earth and cut it into two halves. Great circles are illustrated in figure 3-1. It is important to point out that all meridians are great circles, as is the equator.

A rhumb line is a line that crosses the meridians at the same angle. A constant geographic heading defines a rhumb-line path [15].

A rhumb line, also referred to as a loxodrome, is illustrated in figure 3-2. If extended, rhumb lines would converge at the geographic poles.

B. Magnitude of Discrepancies.

The magnitude of discrepancy between the great-circle and rhumb-line path between two points varies with respect to:

1. The latitude of the mid-point of the path

2. The bearing of the path

3. The length of the path Figure 3-1. Great Circles on the Surface of the Earth Figure 3-2. Rhumb Line on the Surface of the Earth When plotted on a Mercator projection (figure 3-3) the two paths start to diverge from the origin point. They reach the point of maximum divergence at the mid-point of the course, from which they start to converge and finally meet at the destination point. Figure

3-4 shows a great-circle and rhumb-line path plotted on the surface of the earth. The great-circle path always intersects the meridians at higher latitudes than the rhumb-line path. The maximum latitude point reached by the great-circle path is called the vertex. The meridians converge as they depart from the equator and meet at the poles. The rhumb-line path thus needs to curve to form a course of constant meri- dian crossing angle. At higher latitudes, where the meridians are closer together, the rhumb-line path needs to curve rapidly to main- tain a path of constant geographic heading, thus causing the distance of lateral separation between the two paths to increase.

The bearing of the flight, which is determined by the positions of the end points, also has a considerable effect on the discrepancies between the two paths. By definition, all lines of longitude are great circles. On a true north-south course, which would be along a geographic meridian, the two paths are exactly the same, because the meridian also traverses a path of constant geographic heading.

However on a more easterly or westerly heading, the rhumb-line path starts to curve to maintain a constant meridian crossing angle, in the process increasing the distance between the two paths. The maximum discrepancy between a great-circle and rhumb-line path, because of bearing alone, is on a true east-west course.

UNEQUA

ANGLES

Figure 3-4. Great Circle and Rhumb Line on the Surface of the Earth Finally, the third factor that affects the discrepancy between

the great-circle and rhumb-line path is the length of the flight. As

indicated earlier, the great-circle and rhumb-line paths start to diverge from the origin and reach the point of maximum lateral separa-

tion midway into the flight. Therefore, as the length of the paths

increases, the two paths diverge further at the midway point.

To indicate the effect of the factors that cause discrepancies between the two paths mentioned here, a set of equations that model

the flight paths was programmed in FOKTKAN and later implemented in microprocessor machine language in the Loran-C KNAV receiver. The mathematical model is described in the next section.

C. The Mathematical Model.

The model chosen to demonstrate the differences between great- circle and rhumb-line paths was obtained from Bowditch [16]. It was developed for computer applications. The model itself assumes the earth to be a perfect sphere, which can be corrected to conform with

Clarke 1866 ellipsoid using geodesic-error equations. The basic prin- ciple used in the model is to compute points along the two paths given the points of origin and destination. Simple geometric analysis can provide the point of lateral separation. However, the distance bet- ween the two paths, as will be shown, has to be computed using an iterative process.

The following are fixed variables used in the equations of the mode 1. = Latitude of the origin in degrees

= Longitude of the origin in degrees

+2 = Latitude of the destination in degrees X~ = Longitude of the destination in degrees

- 91 + $2 9 = -- mid-latitude point of flight 2

Dlo = A2 - X1 -- Difference in longitude

Dlox = Interval of longitude measured from the longitude

of the origin. This variable depends on the

number of points to be computed along each path.

The points along the rhumb-line track are determined by

where alpha is the true bearing of the rhumb-line path relative from origin to destination.

Dlo 'Cos (P

The points along the great-circle track are determined by

$(Gc) = an-' [Tan(Lv)*Cos(Dlox - Dlov)] (3)

where Lv is the vertex, or the point of the greatest latitude on the great-circle path.

Dlov is the difference in longitude between the vertex and the origin and C is the initial course of the great-circle path.

The distances between the two points along the two paths is given by

/ 2 RLDIST - 60 / - $1) + (D~O*C~~;)~I (7)

GCDIST = 60*~os-~[~in($~)*~in($~) + C~s($~)*~os(+~)*~os(~lo)] (8)

The discrepancy between the two paths is defined by the length of the perpendicular from the rhumb-line path projected onto the great-circle path [17] (line A-B figure 3-5). The maximum discrepancy occurs where the difference in latitude between the two paths is the greatest along a particular longitude. If EF represents the greatest difference in latitude among all in figure 3-5, then DE is the length of the maximum lateral separation between the paths. This can easily be shown using simple geometry where, if EF is greater than

BC and angle DEF is equal to angle ABC, then DE is greater than BC.

To determine the magnitude of the maximum lateral separation, the coordinates of the points D and E must be known. E can be found very easily using the equations for the two paths to determine the longi- tude where the difference between the Latitudes is the greatest. The Figure 3-5. Lateral Separation between Great Circle and Rhumb Line Path equation of line DE is the same as the one for points along a rhumb- line path, except the bearing angle (alpha) differs from the bearing in equation (1) above by 90 degrees. Thus the equation for DE becomes

Point D is defined by the equation for points along a great- circle track equation (3). At the point of intersection of equations

(3) and (9) the solution of the two equations is equal. Thus the coordinates of D can be found using the two equations where we have two unknowns.

Unfortunately the two equations are transcendental equations and thus a closed form solution of the pair of equations does not exist. The two equations are solved using an iterative process called the half-interval step method. This method predicts a value for a function at points half-way to the point of convergence. A final value is usually computed in less than 25 iterations.

The equations mentioned above were executed in FORTRAN on the

Ohio University IBM 3701158 computer. The results of the simulation are presented in Chapter VI. A copy of the FORTRAN listing is pre- sented in Appendix A at the end of this paper.

D. Sof tware Model.

To demonstrate the difference between the great-circle and rhumb-line paths, an implementation in a navigation receiver of the two paths was required. The Ohio University Loran-C receiver was used

for this purpose. A great-circle solution already existed in the

receiver [18], therefore a mdel of the rhumb-line implementation was

needed. The model adopted for the rhumb-line solution was somewhat different from the one described in the previous section.

The range and bearing calculation in the software model were

the same as the ones described in the previous section. The dif-

ference was in the calculation of cross track error. The software is

required to predict the cross track error, from the great-circle and

the rhumb-line paths, between two predefined waypoints, regardless of

the position of the airplane. However the iterative solution described in the previous section assumes that the airplane is on the

rhumb-line path and then computes the cross track deviation from the great-circle path.

To determine the cross track error (CTE) from a particular path

the bearing error due to cross track error (CTEB) must first be deter- mined. For the rhumb-line case the cross track error in bearing is simply the difference in bearing from desired track and the bearing the airplane is presently following to the destination (figure 3-6).

Mathematically this is represented by:

BEARING(from origin to dest.) - BEARING(from present position to dest.)

The cross track error can now be computed as follows:

CTE = RANGE * SIN(CTE8) Figure 3-6. Rhumb Line Cross Track Error The computation of the cross track error from the rhumb-line path as indicated here is very simple because the rhumb-line paths are constant-heading paths. However, the solution for the cross track error becomes complicated because the heading of the great-circle path changes constantly. The great-circle solution is found using the con- cept of back azimuth. The cross track error in bearing from the great-circle path is the difference in azimuth from the destination to the origin and the azimuth from the destination to the position of the airplane. The angles of back azimuth are indicated in figure 3-7.

The cross track error in bearing thus can be computed by:

GC heading(from dest. to org.) - GC heading(from dest. to present pos.)

The cross track error can now be computed as follows:

CTE = RANGE * SIN(CTEB)

The equations described here were implemented in the Ohio

University Loran-C receiver, which is based upon the 6502 micropro- cessor. The implementation provides the receiver the capability to compute great-circle and rhumb-line courses between two predefined waypoints. Another feature in the implementation is the magnetic variation calculation, which provides magnetic heading of a course as opposed to the true heading computed by the model described here. The magnetic variation model is the subject of discussion of the next chapter.

IV . MAGNET I C VARIATION

The bearing computed by point positioning navigation is

generally a geographic true bearing from the present position of the

airplane to a predefined waypoint along a desired course. Radio navi- gation systems such as Loran-C, Omega and GPS do not have the capabi-

lity to provide the current heading of the aircraft [19]. A common

method to determine the current heading is by using the magnetic com- pass, which can provide the heading referenced to the magnetic poles.

The magnetic heading to a desired waypoint differs from the geographic heading by the magnetic variation at that point. The magnetic variation is simply the angle formed between the meridian and the direction the compass needle points (the magnetic north pole), at any

point on the earth [20].

Since the National Airspace System (NAS) is based on magnetic

courses to enable a pilot to fly a heading computed by a true course

RNAV system, an adjustment with respect to the magnetic variation, needs to be made. Although many navigation receivers provide for user

input of the magnetic variation and some have a data base to provide

the information, it is desirable to be able to compute the magnetic variation based on the latitude and longitude position within the

receiver. This chapter discusses a simple implementation of the magnetic variation, also referred to as magnetic declination, based on a mathematical model suitable for avionics receivers. Background.

The basic principle of the operation of a magnetic compass is that magnetic materials of unlike polarity attract each other while the materials of like polarity repel each other. In its simplest form a magnetic needle, when suspended freely, will align itself with the magnetic field of the earth. The earth's magnetic field [21] can be approximated by that of a bar magnet that passes through the center of the earth. The axis of the magnet intersects the surface of the earth at points which are the magnetic poles. In the ideal case the magne- tic and geographic poles would coincide and the material inside the earth would be of uniform permeability. In such a case the horizontal component of the earth's magnetic field would be parallel to the geographic meridians at all points on the surface of the earth.

However, in reality this is not true. The angle rom which the hori- zontal component of the magnetic field differs from the geographic meridian is the magnetic variation at a given point [22]. The magne- tic variation is non-uniform, and may be described as an analytic function of the location of the observation point on the surface of the earth.

The temporal changes in the magnetic variation over the earth are termed secular variation [23]. The secular change is extremely complex; however if the change in magnetic variation at a particular point is measured over a period of years the annual secular change can normally be projected for the next few years. The secular change can also be represented by an analytic function. B. Mathematical Model.

The United States Geological Survey (USGS) publishes magnetic charts for the United States every five years. The need for the charts is to provide information on the magnetic field of the earth to surveyors and navigators. Measurements from 34,000 points are ana- lyzed by least squares procedures to provide an analytical model that defines the regional magnetic field and is used to contour the charts

[24]. Of interest in this discussion is the analytical model that defines the magnetic declination for the conterminous United States

(COT48) region.

To perform the least-squares analysis, the COT48 region was divided into five 12-degree longitudinal bands. Fabiano and others

(251 performed separate analyses of a seventh degree polynomial in each of the five bands. The analysis allowed for 2-degree longitudi- nal overlap at the partition boundaries to minimize edge-effect distortion. The analysis provided coefficients for the seventh degree function that predicts the value of the magnetic declination at a par- ticular point.

The magnetic variation of the earth is subject to constant change. This change may be due to a change in the magnetic field of the earth which causes the magnetic poles to shift in position. To provide an accurate approximation of secular variation, the linear rates of change of the declination over two five year intervals vere determined. A sixth order polynomial function was adopted to perform the secular variation analysis. The COT48 was considered as a whole region for the secular variation analysis and not divided into longi- tudinal bands, as it was in the declination case. The model computes the annual change in the magnetic variation from the base year of the model, which in this case is 1980.

The function adapted for the least squares procedure is of the form

where

aij - coefficients

oc - normalized latitude = 0-52

X~ - normalized longitude A-Y

y - Table 1 - east longitude normalizing factor

0 - co-latitude = 90" - latitude

X - east longitude = 360" - longitude

In the magnetic variation calculation a seventh order function was used and thus 36 coefficients are specified for each of the five bands. However, in the secular variation calculation a sixth order function was used and therefore only 28 coefficients are specified for the entire COT48 region. All the coefficients are given in Appendix

C. Table 4-1 summarizes the limits for each longitudinal band and the values of the constants used in the mathematical model. L

Band Partition OW longitude ~(degrees)

1 66-77 289

2 78-89 277

3 90-101 26 5

4 102-113 253 -. 5 114-125 24 1

r

Table 4-1. Limits on five Bands and East Longitude Normalizing Factor Results of FOKTRAN Simulation.

The mathematical model described above was executed in FORTRAN on the Ohio University IBM 370 computer. Acontour plot of the iso- gonic lines, or the lines of constant variation, was made to compare with the charts of magnetic declination published by various agencies.

Figure 4-1 is a plot of the magnetic variation provided by the simula- tion. Figure 4-2 is a section of a chart of the World Magnetic

Declination [26] published by the Defense Napping Agency (DMA).

Although both the figures match closely on observation, a comparison of the values predicted by the model was made to values published by the National Geophysical Data Center [27] to provide a more accurate verification of the results of the simulation. Table 4-2 summarizes two points in each longitudinal band of the COT48 region where com- parisons were made. The slight discrepancy in the values could arise from the differences in the data and the model. Fabiano and others

[28] evaluated the model and compared to surveyed data for 1,450 points. From these measurements an overall root mean squared deviation of 0.5 degree was found in the magnetic variation in the

COT48 region. Also, a probable cause for larger discrepancies in the region of bands 2 and 3 could indicate magnetic variation anomalies in the Great Lakes region.

In general, the results predicted by the model were found to be satisfactory. The model was implemented in the Loran-C receiver to provide the magnetic variation as a function of latitude and longi- Latitude (degrees ) N

35.7 28.4

A Latitude Longitude Magnetic Variation Band Deg. N Deg. W Actual Com~uted

1 36 77 7.72"W 7 .40°W 66"W - 78"W 40 7 3 13.05OW 12.71°W

2 32 8 1 3.98OW 2.78"W

78"W - 90°W 40 87 1.12OW 0.5l0W

3 34 93 4.37 "E 5 .90°E

90°W - 102OW 38 101 9.05"E 10.84OE

-

4 36 103 9.93"E 10 .91°E

102OW - 114OW 40 107 12.62"E 13.54OE

5 38 123 16 .18"E 16 .5g0E

114"W - 126OW 32 113 12.58"E 13.25OE

: *

Table 4-2. Comparisons between Actual and Computed Values of Magnetic Variation. tude, along with other navigation information computed by the receiver. The system description and software implementation are discussed in the next chapter. V. SYSTEM DESCRIPTION

In order to demonstrate the validity of the mathematics pre- sented in the previous two chapters, it is essential to implement the models in a navigation receiver and verify the results by flight measurements. The Ohio University Loran-C receiver was chosen to test the models. The receiver is a prototype Loran-C navigation receiver designed for research applications and is extremely versatile. It allows additions and changes in software to be made very easily.

A. Hardware Descriotion.

The prototype Loran-C receiver is a single-chain master- dependent system which allows tracking of three stations [29]. The receiver utilizes an external antenna and preamplifier system (figure

5-1). The antenna is a short whip antenna which is connected directly to a wideband preamplifier/coupler. The preamplifier includes a 120 kHz lowpass filter to restrict operation of the system to low frequen- cies [30]. The active external antenna/preamplifier system is con- nected to an RF sensor via a coaxial cable. The RF sensor drives the antennalpreamplifier configuration through a highpass filter coupler, providing 30 to 40 milliamperes at 8 volts (DC) required for operating such preamplifier systems.

The RF processor is an envelope detector. It is driven by the output of the wideband preamplifier. The input circuit of the pro- cessor contains a transformer, the output of which is placed across a Antenna Display Terminal Data Entry

v 1 RS-232 Computer 6502 I- AGC RF > Display Terminal Preamp + Processor 4 Processor ) " Super-Jol t"

r - A - A YclBucket v i

Video TD- to-Geometric > Display > CRT Board Display

RNAV -Software

Figure 5-1. Block Diagram of Ohio University Loran-C Receiver potentiometer to provide a gain control of the signal to the user.

Before the RF signal is amplified, it passes through a trap circuit.

This eliminates the interfering signals close to the 100 Uz region.

Once some of the interfering frequencies are minimized the signal is amplified by a tuned RF amplifier which provides a +30 dB gain and 30 kHz bandwidth centered at 100 kHz, the frequency of the carrier. The signal is now sent into two branches. One of these paths drives a T- notch filter, which delays and then adds the delayed portion to the actual incoming signal. This delay-and-add circuit produces a phase reversal at the 30 us point of the signal where the tracking takes place. The second path is sent to a limiter that produces a signal for input to a demodulator and the zero-crossing detector. The two paths are now fed through a lowpass 20 kHz bandwidth RC filter, which acts as an envelope detector to create a Loran-C envelope signal.

This in turn produces a digital pulse at the zero-crossing of the rising edge of the carrier. Thus the RF sensor produces a digital pulse on every occurrence of a Loran-C envelope pulse. These digital pulses are stretched to 70 microseconds [31] to allow the tracking loop routines ample time to lock on to the Loran signals.

The digital pulses produced by the RF processor are passed to a processor controlled timing module [32]. The timing module uses a

Mostek 50395 timing integrated circuit which has a built-in BCD counter, driven by the main receiver clock, a temperature-compensated crystal oscillator. The digital pulses from the RF sensor are loaded into a register which sets a sample time, at which time a processor interrupt occurs. Then a check is made to see if a Loran-C pulse is present. If not, the sample time is changed with respect to the BCD counter, which is in free run mode. However, if a Loran-C is present, the interrupt signal is used by the software in tracking and locking onto the Loran-C pulses. Once three stations are being tracked, the signal levels at the iU? input processor are stablized by a commutated automatic gain control (AGC) [33] circuit under the control of the main receiver microcomputer.

The Super-Jolt microcomputer is used as the main receiver pro- cessor. The Super-Jolt is based on the Hostek 6502 8-bit micropro- cessor chip and uses a 1 MHz clock [34]. An instruction set for the

6502 is given in figure 5-2. The system at present contains 16K bytes of memory for the navigation programs which can be expanded as the need arises. The navigation calculations that provide the information desired require a numerical range of the order of 10" to lo6.

Such orders of magnitude require floating point format. Further, some of the calculations involve complex mathematical, trigonometric and logarithmic operations. A 6502-based microprocessor with an 8-bit data bus requires a large amount of memory and rapid access to perform some of these calculations. It is therefore desirable to supplement the operation of the microprocessor with an external device.

The Advanced Micro Devices floating point arithmetic processor

(Am 9511) was chosen to add onto the microcomputer system to perform the complex mathematical operations. The 9511 was designed to supple- ADC Add with carp JSR Jump to subroutine AND Logical AND LDA Load accumulator ASL Arithmetic shift left LDX Load X BCC Branch if carry clear LDY Load Y BCS Branch if carry set LSR Logical shift right BEQ Branch if result = 0 NOP No operation BIT Test bit ORA Logical OR BMI Branch if minus PH A Push A BNE Branch if not equal to 0 PHP Push P status BPL Branch if plus PW Pull A BRK Break PLP Pull P status BVC Branch if overflow clear ROL Rotate left BVS Branch if overflow set ROR Rotate right CLC Clear carry RTI Return from interrupt CLD Clear decimal flag RTS Return from subroutine C LI Clear interrupt disable SBC Subtract with carry CLV Clear overflo\v SEC Set carry CMP Compare to accumulator SED Set decimal CPX Compare to X SEI Set interrupt disable CPY Compare to Y STA Store accumulator DEC Decrement memory STX Store X DEX Decrement X SY Store Y DEY Decrement Y TAX Transfer A to X EOR Exclusive OR TAY Transfer A to Y INC Increment memory TSX Transfer SP to X INX Increment X TXA Transfer X to A INY Increment Y TXS Transfer X to SP JMP Jump TYA Ztansfer Y to A

Figure 5-2. lnstruc tion Set of Mostek 6502 Microprocessor ment microprocessors with an 8-bit data bus; however, it can handle 16 as well as 32-bit numbers in the floating-point format [35]. An M6820 peripheral interface adapter (PIA) is used to allow for interface of handshaking signals between the 9511 and the Super-Jolt microcomputer system [36]. An instruction set of the 9511 is given in figure 5-3.

A block diagram of the microcomputer system is shown in figure 5-4.

The Super-Jolt microcomputer has an RS-232 interface to allow for input via an ASCII terminal. The output features include a VDM-1 video board [37] which can display 512 characters on a CRT screen.

The prototype receiver also has an Asynchronous Serial Interface

Adapter (ACIA) to allow for data to be recorded on tape. This feature is extremely useful for obtaining data during flight measurements. A recent addition in hardware allows for the ACIA to receive input data for navigation calculations while carrying on the necessary real time computations.

B. Navigation Programs

There are now four navigation programs on the prototype Loran-C receiver. The main program, LORPROM, is the software for the timing module discussed in the previous section. The main function of

LORPROM is to track the Loran-C pulses. This is done by phase-locked loop operation providing two time differences , which represent the loci of time difference of the slave stations with respect to the master. The software is interrupt-driven, the interrupts being pro- vided on the occurrence of sample pulses in the timing-module cir- 1 Command 1 Hex Cod* Hex Gxh Execution 1 Sum- 3 Mnemonlc 1 (sr = 1) i (sr = 0) Cycbr , hscrwbn I ieerr FIXED-wwO+=ERATK)MS - - - SAOD EC 6C 1618 MdTOSloH3S.R.w(mNOS.PwSLvt i SSYB ED 60 10lt - 1 --TOS Ifom NOS. Pal lo NOS. pop SMUL EE 6E MmptyNOSbyTOS.LoranrrntoNOS.FwSI.dr- I

I SMUU F6 76 MumpcrNOSbyTOS.Vaar~ONOS.PopStadc. 1 SOlV EF 6F bCW Dw& NOS by TOS. R.uM to NOS. POD SUc*. I 12-BK FiXED-POW OPERAMS

AC 2C 20-22 I Md TOS lo NOS. RsM U NOS. POP SlvlL I DSUB 1 20 JMO kncM TOS hum NOS. Pmsuil to NOS. Pop Suct. j DMUL 2E 14C210 I hbmpy NOS by TOS. Latr- lo NOS. PW S- 182-218 MuIw WSby TOS Upp.r reudt lo NOS. Pw Sub DOlV 1S210 , MNOS by TOS. R.wl lo NOS POc SUdr I 32-8rT FLOATHGPORTr PRIMARY OP€RATK)M FA00 90 10 54.- M TO5 m NOS. R.s.ilU NOS. Po0 Sudc j FSUB 91 11 7G370 SuwDa TOS hum NOS. R.at lo NOS. Pop Sod 1 FMUL 92 12 146-1611 hWWyNOSbyTOSRrvn~NOSPwStsdL 1 iOlV 93 13 154184 O~~~HOS~~TOS.R.WP~OS.PODS~ ! 32-BK FLOARP(G?WNT DERMD Oe(EM'I7WS I SORT 81 01 782470 %umrmRmcdTOSR.adt~TOS. 1 SIN K 02 37- Sns of TOS. R..M m TOS. I WS 83 03 340478 of TOS. W o TOS. I TAN 84 04 -5866 Ta-qu#ol TOS burl( lo TOS. I ASIN 85 05 62307~24 invmn %u0f TOS. Pa- (o TOS. ACOS 86 W 63!ndza hnwnCovrofTOS.R.aLnmTOS ' I ATAN 87 07 4992-6536 Tupr* d TOS. R.ud lo TOS LOG U74-7132 Commcn- Logamtun of TOS R.WI lo TOS ! 88 D8 I LN 88 09 bar&~c-pmm d TOS. lo TOS. EXP 8* OA e rudlo -n TOS. Pasun lo TOS PWR 88 08 NOSrour61omrnTOSReumloW3S.PcoSW I DATA AH0 STACK MANPUUROn OPfRAM NOP / No -am. Char or ut SVREO. FIXS I I 1 1 -eri TOS I- prdt-t 10 @xed-1 lwnut. FIXo I 9E :: i FLTS Convmn TOS lrom baa panl tormat m hung parrr (omur ' FLTO cnss cnso Chtnp.uao1 ruaa~qntaumdmTOS. CHSF Chnw wpn of baabng pont -rand m TOS. pros PTOD F'um sack. WuteNOS vr TOS. I VOF I pops mpo FWslack Ola NOS bssDlrrr m TOS. 0(0 TOS router to Donom. POPF I xcns 1 xcno EMUP. TOS md NOS. i XCHF 1- Wpl Push hvqwml want r gnu TOS. Pfmnars TOS D.comr NOS.

Figure 5-3. Instruction Set of Am 951 1 Arithmetic Processor Figure 5-4. Block Diagram of the Micro-Computer System cuitry. This allows the main processor to perform other computations between interrupts. The AGC circuit is toggled by PIA lines after all three stations have been locked by the program. The LORPROM routine is also responsible for initialization of the video board as well as all handshaking services. The tape output routines operate in the

LORPKOM background. Incorporated also are and RETUCK switches.

The EVENT switch outputs an event mark on the tape output, while the

RETRACK switch clears a master track switch which starts the phase- locked loop search operation over again.

Once all three stations are being tracked the LORPKOM program calls the URB subroutine. This subroutine is responsible for the conversion of the time differences into geodetic coordinates of posi- tion [38]. The computations in this routine require the use of the

Am9511 arithmetic floating point processor. To allow for interaction between the 6502 microprocessor and the 9511, special subroutines are needed to initialize and communicate with the 9511. Four subroutines

-- PINT, PUSH, POP and CImD - were written by Fischer 1391 with this goal in mind. PIIiT initializes the PIA and the RAM locations used with the 9511 processor. PUSH sends a four byte floating point number to the stack of the 9511 from user RAM. POP does exactly the opposite by copying a four byte number from the stack of the 9511 into user

RAM. CMND sends a command to the 9511 to perform a specified opera- tion. A flow diagram of all four subroutines appears in figure 5-5.

After the TDs have been converted into geographic coordinates in the form of latitude and longitude, the software is ready to per- PINT PUSH-

Clear lnter~pts Set PIA side-A to ar tpu ts *Set in term p t and control bits in 6820

Set 1/0 direc- I tions in 6820 of numbers

Disable 951 1 end to 951 1 via fl PIA side-A \1 Initialize RAM Set WR and C/D low on locations For scratch-pad use 951 1 via PIA side-B

Set WR high on I I 9511

/ [~ecrementcount I

to Inputs I END I

Set Count of

Set 3 and Figure 5-5. Flow charts of Inter- face Subroutines for Am951 1 go high

Transfer 8-bi ts from 951 1 via PIA CMND

SET PIA SIDE-A TO OUTPUTS I

SEND 8-BIT COMMAND TO 951 1 VIA PIA SIDE-A

SET C/D HIGH, WR LOW I

WAlT FOR END TO COME HIGH

SET PIA SIDE-A TO INPUTS

SET C/D HIGH, RD LOW

WAlT FOR PAUSE

GET 8-BIT STATUS FROM 951 1 VIA PIA SIDE-A

I DISABLE 951 1 1

Figure 5-5. Continued. form the calculations to provide navigation information. This is done in the RNAV program, which is a continuation of the LLRB routine. The

RNAV program is responsible for the computation of navigation infor- mation such as range, bearing, cross track error, ground speed, esti- mated time of arrival and a CDI indicator. A flow chart of the RNAV program is shown in figure 5-6. It has four parts [40].

The RNAV routine requires two items of input for execution.

First is a set of geographic coordinates in the form of latitude and longitude, which are provided by LLRB. Second, the RNAV routine requires a pair of waypoints that define the origin and destination of a desired flight path. These need to be provided by the user and must be entered in the waypoint table. The first part of WAV is respon- sible for displaying the waypoints and converting them from BCD to floating point format compatible with the 9511. The waypoints may be input from the ASCII terminal before the software is initialized or via the ACIA after the software is in the cornputation process, a pro- cedure which will be discussed later.

The second part of RNAV calculates the range and bearing angle.

In the first loop, which includes all three programs discussed thus far, the range and bearing of the desired course are computed. The computations to provide range and bearing from the present position to the destination are done starting with the second loop through the software. The third part of this routine calculates cross track error from the great-circle course. (The equations for these computations and FROM Waypoint No..

No

Display FROM/TO . Waypoi nt 4 W Get Coordinates of the kceiver fr0m.i ts Get Coordinates of the emory Locatr on WPTs from the WPT Table

Range Computation

Bearing Computation

Convert GRI into 32-bi t Fixed-Point Format-

CTEB Computation Blank Display for RNAV Information

CTE Computation

Store Range/Bearing of

Return to the Main Program Figure 5-6. Flow Chart of RNAV Program. CDI Display I

>I

> v Return to the Main Program

a - p filter for GS

4 b

YES . Blank Display for ETA

F ETA Computation

4 b \1/ Return to the Main Program

Display on the CRT screen and go to the next block

Figure 5-6. Continued. were specified in Chapter 111). Finally the last part of RNAV com-

putes the ground speed and estimated time of arrival to the destina-

tion waypoint. The ground speed computations use an alpha- filter

[411

After the computation of the cross track error in RNAV there is

a call to the RLCALC subroutine. This subroutine computes all the

rhumb-line navigation information as well as the magnetic variation.

The implementation of RLCALC is discussed in the next section.

C. Rhumb Line and Magnetic Variation Software.

The RLCALC subroutine is called by RNAV and is responsible for

computing the rhumb-line navigation information. The mathematics to

implement the software were developed in chapters 111 and IV. This

routine computes rhumb-line range, the magnetic heading to the desti- nation waypoint, the magnetic variation at the present position of the

receiver and the cross-track error from the rhumb-line course. This

routine requires two inputs. The first input is the coordinates of

the origin and destination to define a desired course, while the

second input is the latitude and longitude of the present position of

the receiver.

This program uses the 9511 to assist in the computations. It

can be separated into two sections. One section computes the range,

bearing and the cross-track errors, while the other section computes

the magnetic variation. The range and geographic bearing from the present position to the destination waypoint are computed the first

time through the loop, along with other information. However, the bearing is adjusted with respect to the magnetic variation the second time the subroutine is called. A flow chart of the RLCALC routine appears in figure 5-7.

The computations of range, bearing and cross-track error are straightforward. The equations developed in Chapter 111 are imple- mented using the 9511 processor for the mathematical and trigonometric operations. Memory locations starting at $0100 are used as scratch for storing the variables computed by the 951 1. The 9511 inter- face subroutines are set up in such a way that the indirect addressing feature of the 6502 processor can be used. The base address of scratch-pad random-access memory (RAM) is stored in two zero page locations called BASE. By loading the Y register of the 6502 with the low address byte of the variable in scratch space, a four byte number can be sent to and copied from the stack of the 9511 processor using

PUSH and POP subroutines. To send a command to the 9511, the accumu- lator of the 6502 needs to be loaded with the byte specified in the instruction set of the math processor. The subroutine CMND then sends the command to the 9511, which performs the execution process. The

CMND subroutine waits for the 9511 to complete the execution of the command before control is passed back to the 6502 microprocessor.

This procedure allows the 9511 to perform the mathematical operations to calculate the rhumb-line navigation information. A flow chart of how the 9511 executes an arithmetic operation is given in figure 5-8. ENTER FROM RNAV

COMPUTE MID-LA TITUDE, DIFFERENCE IN LATITUDE, DIFFERENCE IN LONGITUDE BETWEEN RECEIVER POSITION AND DESTINATION.

COMPUTE RHUMB LINE RANGE AND BEARING

CALCULATE MAGNETIC 'VARIATION 8( ADJUST . Rl NG

COMPUTE MI D-LATITUDE, DIFFERENCE IN LATdTUDE, DIFFERENCE IN LONGITUDE BETWEEN ORIGIN&DESTtN4TION

COMPUTE CROSS TRACK ERROR IN BEARING AND DISTANCE

4

i DISPLAY ON RETURN TO RNAV CRT & CONTINUE WITH NEXT BLOCK

Figure 5-7. Flow Chart of RLCALC Program SET CORRECT

LOAD REGISTER WlTH ADDRESS OF 1st OF THE 4 BYTE NUMBER ( A )

4 PUSH 4 BYTES TO STACK OF 951 1

'LOAD REGISTER WlTH ADDRESS OF 1st OF THE 4 BYTE NUMBER ( B ) I

PUSH 4 BYTES TO STACK OF 951 1 +

r SEND CMND TO 9511 TO PERFORM OPERATION [EX. FMUL MULTIPLY^ b

. A LOAD REGISTER WlTH ADDRESS OF 1st BYTE OF 4 BYTES WHERE RESULT OF A * B IS TO BE STORED .. POP 4 BYTES FROM STACK OF 951 1 A Figure 5-8. Logical Steps of How Am951 1 Executes an Arithmetic Operation The magnetic variation is calculated within the RLCALC program.

The computation is an implementation of the least-squares polynomial developed in Chapter IV. The coefficients used for the model are stored in memory in one-page sectors (256 bytes). For the magnetic declination calculation, 36 coefficients are required for each geographic band, where each coefficient must be represented as a

4-byte floating point number compatible with the 9511 floating point format. The inputs for the routine are the latitude and longitude, where the variation value is to be computed. This is obtained from the LLRB program discussed earlier. A flow chart of the magnetic variation routine appears in figure 5-9.

Upon initialization of the polynomial counters, the fixed variables are computed. These variables, the co-latitude, east longi- tude and normalized latitude of the point are stored in scratch space.

Next a test is performed to determine which of the five longitudinal bands contain the present position, to point to the correct address in the coefficient table. The first four bytes of the coefficient table represent the normalized longitude for the particular band, followed by 36 coefficients for each of the five bands represented by a 4-byte number compatible with the 9511 floating point format.

The values indicated by the two counters are also the exponents of the polynomial function. The exponent calculation however, is more complicated. The 9511 uses exponential and logarithmic functions to compute powers of numbers. The processor will not raise a negative NO I INCR. COUNTER CO NTI NUE * JNlTlALlZE LOOP COUNTER

C'OMPUTE CO-LATITUDE EAST LONGITUDE AND NORMALIZED LATITUDE FOR RECEIVER POSlTlON

TEST TO DETERMINE LONGITUDINAL BAND OF

SET ADDRESS OF COEFFICIENT TABLE TO CORRESPOND WITH CORRECT LONGITUDINAL BAND

ADJUST EAST LONGITUDE TO NORMALIZED LONGITUDE FOR CORRECT BAND Figure 5-9. Flow Chart of MAGVA R Program

COMPUTE CORRECT

TEST FOR SIGN PERFORM EXPONENT COMPUTATION USING

ATTACH CORRECT SIGN AFTER EXPONENT COMPUTATION

P LOA D COEFFICIENTS AND MULTIPLY , ADD TO CUMUL- ATIVE VALUE OF VARIATION

I lYl-iLi\ \ YES OOP CTR

INCREMENT-INNER LOOP CTR, COEFFICIENT TABLE CTR AND COMPUTE NEXT VALUE Dl SPLAY MAG NETIC VARIATION

SET INNER LOOP CTR TO INCREMENT OUTER LOOP CTR, INCREMENT COEFFIC IENT TABLE CTR COMPUTE NEXT VALUE number to a power. A special test first checks to see if a number is negative. If so, then the value of the exponent needs to be tested to determine if it is odd or even so the correct sign can be attached to

the result after the exponent calculation. ' Once this is done the absolute value of the number is raised to the power specified and then the correct sign attached. Once the value of the two counters is equal, it signifies that that the inner loop is finished. The inner counter is cleared while the outer counter is incremented. This pro- cedure is repeated seven for the seventh order polynomial. The output of this routine is the value of magnetic variation at the spe- cified position. This value can now be used to adjust the geographic bearing to provide a magnetic heading to the destination point.

The RLCALC subroutine thus computes the rhumb-line range, bearing and cross-track error, as well as the magnetic variation. The subroutine takes approximately 1.2 seconds to execute. A large por- tion of that time is needed in the computation of the seventh order polynomial. Since the magnetic variation does not change by a signi- ficant amount over a small change in geographic position, it does not need to be computed every time the other navigation information is updated. The implementation reported here calls for the computation of magnetic variation every 255 loops through the software. This translates to computation of magnetic variation approximately every 6 minutes and, as shown in the next chapter, is considered sufficient. D. ACIA Input Software.

As mentioned earlier the hardware was modified slightly to allow the ACIA on the prototype receiver to accept waypoint inputs without stopping the software. This feature is very helpful during flight measurements. Once the new waypoints are entered into the receiver, the navigation software automatically computes updates to the navigation information corresponding to the new points of origin and destination without stopping the software and having to start the phase-locked loop operation again. The RNAV program calls this subroutine (CDUINP) before the conversion of the waypoint table data.

A flow chart of CDUINP is shown in figure 5-10.

Upon entry into CDUINP a check is made to the data receive flag to determine whether the ACIA has received a data byte, which is tested to make sure it is the correct identification byte. If this test fails, the software exits this subroutine to carry on with other computations in RNAV. If the identification byte is correct, the software waits in a loop until all waypoint information is entered and received by the ACIA and stored in the correct locations in the waypoint table. The navigation information is not computed during this time; however, the interrupt driven sensor routine can take control of the processor every time an interrupt is caused by the timing module circuitry. The correct form of data entry for the waypoint table is also shown in figure 5-10.

Complete program listings of the RLCALC and CDUINP are given in the Appendix D and E at the end of this report. This configuration of ENTER FROM RNAV [

Nn

SET FLAG SET POINTER SET CHAR CNT., I

CHARACTER POINTER

YF? I CONVERT CHARACTER FROM ASC TO BCD AND STORE IN WAY GET NEXT POINT TABLE CHARACTER L -

CORRECT FORM OF WAY POINT ENTRY WAY POINT NO. LATITUDE LONGITUDE the prototype Loran-C receiver was flight tested to allow for verifi- cation of the mathematics developed in Chapters 111 and IV. The results of the flight measurements are discussed in detail in the next chapter. VI. RESULTS

The mathematical models developed in Chapters I11 and IV were

initially executed in FOKTRAN on the Ohio University IBM 370 computer.

To verify the results, the models were implemented on the the Loran-C receiver, and were tested in flight.

A. Simulation of Great Circle and Rhumb Line Paths.

To illustrate the differences between great-circle and rhumb- line paths a series of plots were generated by a computer. The plots

indicated the two paths on Mercator projection, which were also generated by the computer model. The simulation computed the value of

the maximum track error, which is the distance between the two paths at the point of maximum lateral separation.

The flight paths for the initial simulation were chosen with

the aim of backing the assertions made in Chapter I11 regarding the discrepancies between the two paths. An attempt was made to cover the

three major types of paths -- east-west routes, diagonal routes and north-south routes.

Figures 6-1, 6-2 and 6-3 represent simulation plots for paths

that are essentially east-west routes. On an east-west path the rela- tive bearing between the two waypoints is very close to 0 degree. The difference in latitude of the two points is small. The track errors between the two paths are the greatest on such flight paths, the

magnitude of the track errors increasing as the mid-point latitude of

the path increases.

0 m m CRERT CIRCLE YS. RHUHB LINE RL ST. LOUIS INI'L LAT.=30.B8 N LONG.--90.47 Y DENVER STAPELTON LR1.=39.17 N LONG.--IO4.BB H GflFfll CIRCLE UlSTRNCE =670.00 NNl RllUNB LINE OlSlRNCE -670.13 Nlil HnXlNllli TRACK ERROR =15.68 NHI RCLATIVE BERnlNC -4.58 OEC.

R.

9 3 m ll.

N m 2.m w R- n 2 ew C - a: -Jm (r) .

m O m m.

r- m m 81.

10

LONGITUDE N

Figure 6-3. Great Circle vs. Rhumb Line Diagonal routes are simulated in figures 6-4, 6-5 and 6-6. The values of the maximum track error as indicated in the plots decrease compared with the values on east-west routes. The relative bearing on these routes is more in a north east to south west direction or vice- versa. Comparisons of figures 6-1 (New York to Los Angeles) and 6-4

(Portland, ME to Phoenix, AZ) indicate the effect the bearing and mid- point latitude of the flight have on the track errors between the great-circle and rhumb-line paths. Although the trip lengths in the two cases are almost the same, the difference in the maximum track error is 8 nautical miles.

As mentioned earlier, the great-circle and rhumb-line paths on a true north-south course are exactly the same. This is indicated in figures 6-7, 6-8 and 6-9 which are simulations of paths that are essentially in a north to south direction. The relative bearing bet- ween the two waypoints is close to 90 degrees. The magnitude of the track errors is much smaller in this case compared with the previous two examples.

The examples mentioned thus far illustrate the basic differ- ences between the great-circle and rhumb-line paths. It is of impor- tance to indicate the discrepancies on typical shorter trip lengths.

Keeping this in mind, an effort was made to quantize the discrepancies of paths of different relative bearing and mid-point latitudes.

The simulation was modified to generate a series of plots that depict a family of curves indicated in figures 6-10 through 6-13. The

0 9, rn LAT.= 50.0 AT BANG.= 46.04 LAT.= 45.0AT BANG.- 43.31

0 P-- LAT.= 40.0 AT BANG.= 41.09

0 MT.=35.0 AT BANG.= 39.14 9.. 0 LAT.= 30.0 AT BANG. = 37.59

0 -U 0... Z 0 E LAT.= 25.0AT BANG. = 36.34 a a?..00 CEe W x I- e9..UP P

P

N

0O

Figure 6-12. Track Error vs. Trip Length at Relative Average Bearing 40

85 simulations of each plot were done at constant bearing. Each of the curves on a plot has the specified mid-point latitude. Comparison between the plots shows the compound effect bearing and mid-point latitude have on the track errors between the two flight paths.

Figure 6-10 is a plot of path errors at an average relative bearing of

76 degrees, which can be considered a north-south route. The errors are less than 1.5 nautical miles for trip lengths up to 330 nmi. The errors start to increase as the trip length gets longer and as the mid-point latitude of the route gets closer to the geographic poles.

The magnitude of the errors starts to increase as the relative bearing gets more easterly or westerly as is indicated in figures 6-11 and

6-12. For the worst case illustrated by the simulations (figure

6-13), at an average relative bearing of 18 degrees, the errors bet- ween the two paths reach more than 10 nmi for trip lengths less than

500 nmi.

B. Flinht Tests.

The implementation of the simulations described in Chapter V was tested for approximately two hours of flight on July 16, 1984.

The main goal of the tests was to determine if the model was computing correctly and whether the errors from the receiver matched the errors predicted by the model. In order to determine the path errors between great-circle and rhumb-line courses it is desirable to fly along one of the paths and record the cross track errors from the other path.

Since the errors for short trips predicted by the simulations were not very significant it was decided to focus on longer trips to determine the validity of the simulations. The costs involved with flight tests on long trips can be significant. To reduce some of the expenditure, it was found that data collected for a short segment of a long trip would be sufficient to verify the model. Two paths were chosen for flight tests. One was essentially an east-west path while the second one was a diagonal path. The paths were chosen so that they would cross a known visual landmark.

Henderson (HNN) VOR, in Western West Virginia was chosen as the visual landmark. Flight origin and destination coordinates were cho- sen such that the flight path would pass directly over HNN or close to it. In the actual flight an attempt was made to fly along a specified radial of HNN VOK that would approximate the rhumb-line flight path between the chosen waypoints (figure 6-14 and 6-15). The radial for the two flight paths was computed by the computer simulation and adjusted for magnetic variation, also computed by the declination model. During the flight, data were collected in the form of cross track errors from the great-circle and the rhumb-line paths.

Flight test 1 was from 41 20.0 N, 105 0.0 W (near Boulder,

Colorado) to 37 22.0 N, 70 0.0 W (a point off the coast of Baltimore).

The radial bearing into HNN VOK along the rhumb-line path between these waypoints flown was 102 degrees. A flight of approximately 30 nmi was flown along this segment, 15 nmi on either side of HNN. The latitude and longitude data computed by the receiver were then plotted -Great Circle Path

/Great Circle i Cross Track Error

;i HNN VOR

Actual Path Rhumb Line Cross Track Error Rhumb Line Path

-42.YOO , -62.120 -4Z.ZUO -42.180 -42.010 -62.000 -41.920 -4l.IUO -41.780 -41.100 -41.800 LONGITUOE Id

Figure 6-14; Path of Flight Test I Line Path

Cross Track Error

Figure 6-15. Path of Flight Test 2 with the actual courses that defined the flight path as computed by

the simulation. Figure 6-14 represents the path of flight test 1

along with the actual great-circle and rhumb-line paths of the desired

segment between the two waypoints. The cross track errors from the

particular paths for the points indicated are shown in table 6-1.

Although data were collected at intervals of approximately 1.5 seconds as computed by the receiver, it is not all shown on the plots for

reasons of clarity. The data collected by the receiver were then

compared to similar values computed by the computer simulation. The differences were found to be minimal.

Flight test 2 was from 43 0.0 N, 75 0.0 W (near Utica, New

York) to 33 0.0 N, 90 0.0 W (near Jackson, Mississippi) The radial heading flown into HNN was 228 degrees. Figure 6-15 is a plot of the actual path of flight test 2 along with the great-circle and rhumb

line paths between the two waypoints. Table 6-2 summarizes the errors from the particular paths and compares the errors from the receiver to the errors derived from the computer simulation.

C. Tests of Magnetic Variation Implementation.

All of the data collected during the flight tests were over a relatively small geographic area. The change in magnetic variation over this small area recorded by the data collection system of the

receiver was only 0.4 degree. Although the numbers predicted by the

receiver implementation matched the values predicted by the simula-

tion, additional tests were carried out using a Loran-C simulator. 1

POINT ERRORS FROM GREAT CIRCLE TRACK ERRORS FROM RHUMB LINE TRACK (EI (yI)

RECEIVER COMPUTER RECEIVER COMPUTER COMPUTATION SIMULATION COMPUTATION SIMULATION

A 74.30 74.12 0.30 0.22

B 74.60 74.40 0.10 0.19

C 73.70 73.62 0.60 0.47

D 73 .OO 72.78 1.10 1.14

E 72.90 72.71 1.10 1.10

F 72.90 72.78 0.90 0.90

G 72.80 72 -59 0.90 0.93

H 72.70 72.60 0.80 0.79

I 72.80 72.51 0.60 0.70

J 72.40 72 -07 0.90 0.99

K 72.30 72 -09 0.80 0.85

L 72.10 71.95 0.90 0.87

I T

Mean Error Difference for Errors from Great Circle Track = 0.198 NMI Standard Deviation = 0.073

Mean Error Difference for Errors from Rhumb Line Track = 0.054 tWI Standard Deviation = 0.043

Table 6- 1. Comparison of Cross Track Errors for Flight Test I 4 POINT ERRORS FROM GREAT CIKCLE TRACK ERRORS FKOM RHUMB LINE TUCK (*I) (YI)

RECEIVER COMPUTER RECEIVER COMPUTER COMPUTATION SIMULATION COMPUTATION SIMULATION

A 16.40 16.33 2.40 2.46

B 16 -30 16 -64 2 -50 2.15

C 16.30 16 -56 2.40 2.24 -. D 16.80 16.98 2 .OO 1.83

E 16.90 16.98 1.90 1.84

F 17.20 17 -21 1.60 1.62

G 17.50 17 -48 1.30 1.35

H 17 -90 17 -81 0 -90 1.02

I 17.80 17.97 1 .OO 0.86

J 18 .OO 18 -04 0 -80 0.79

K 18 -20 18.18 0.60 0 -65

L 18 -60 18 -57 0.20 0.27

M 18 -80 18 -79 0 .OO 0.05

Mean ~rrorDifference for Errors from &eat Circle rack = 0.117 NMI Standard Deviation = 0.122

Mean Error Difference for Errors from Rhumb Line Track = 0.101 NMI Standard Deviation = 0.091

Table 6-2. Comparison of CrossT Track Errors for Flight Test 2 The simulator was set up for TD values within the 99600 GRI chain.

The receiver, upon locking to the signals, computed the other naviga-

tion information, including the magnetic variation. Table 6-3 sum- marizes some of the tests made in the laboratory using the Loran-C

simulator 1421 . Latitude Longitude Magnetic Variation Magnetic Variation (deg. N) (deg. W) (Fortran simulation) (Receiver computation) (deg. W) (deg. W)

40 -00 80 .OO 5.88 5.8

35 .OO 75 .OO 8.16 8.1

35 .OO 82 .OO 2 e63 2.6

40 .OO 75 .OO 10.24 10.2

39.33 82.10 3.87 3.8

38.23 71.25 12.45 12.4 +

Table 6-3. Magnetic Variation Tests Using Loran-C Simulator VII. CONCLUSIONS

The difference in the data recorded during flight measurements and the data computed by the simulations was found to be minimal.

Mean error difference of 0.198 mi with a standard deviation of 0.073 nmi for flight test 1 was found for the worst case. The worst-case mean error difference for flight test 2 was 0.117 mi with a standard deviation of 0.122 nm' It can now be assumed that the mathematical simulation provides a data base to project the discrepancies between great-circle and rhumb-line paths. Although the Loran-C system was used to verify the simulation model, the results provided in this work are applicable to all position-fixing receivers.

Position fixing receivers allow for course computations based on the great-circle path. Conflicts may arise from aircraft using such navigation systems in airspace defined by the rho-theta system.

Discrepancies between the two path types over long flights can be significant. Altitude separation in the NAS reduces this problem, permitting the fuel-saving great-circle routes to be used at higher altitudes.

At lower altitudes typical flight segments flown between two

VORs may be 150 nmi. Examination of the data shows that at the worst case the errors between the two flight paths are less than 2 mi.

This worst case situation would arise on an east-west flight at a latitude of more than 45 degrees in the continental United States.

Although this error is well within the +4 nmi airways defined for GA aircraft operations, it represents the error arising solely from geometrical path discrepancies. If a pilot on such a route were to deviate from the course defined by the position-fixing receiver by 2 nmi, he could exceed the limits specified for an airway.

Since a majority of the airways in the United States are below

40 degrees latitude the errors in the two paths should not provide a cause for conflict in the airspace. There is minimal difference bet- ween the great-circle and rhumb-line paths along routes oriented in the north-south direction.

The rhumb-line and magnetic-variation implementation in a posi- tion fixing system allow a pilot to follow a course defined by the rho-theta system. This feature will be useful during a scenario where a conflict of flight paths may occur. The receiver thus has the abi- lity to compute a course that is compatible with the existing airways based on the VOR navigation system.

It should be recognized that the errors mentioned in this study are solely due to the discrepancies between the great-circle and rhumb line flight paths. Other sources of error may be due to receiver and computational errors which are unique with every navigation system.

Any decision made regarding this subject must include all possible sources of errors, not just the geometric discrepancies.

Implementation of different models of the earth in various navigation receivers .my also provide certain errors in position com- putations. To eliminate this problem a standard model should be defined which is compatible with the computations carried out by the

Air Traffic Control computer system. VIII. ACKNOWLEDGEMENTS

The work presented in this thesis was supported by National

Aeronautics and Space Administration (NASA) Langley Research Center at

C Hampton, Virginia under grant NGR 36-009-017. The grant supports the

Joint University Program for Air Transportation Research at Avionics

Engineering Center at Ohio University.

The author wishes to express his deepest gratitude to Dr.

Robert Lilley, who served as advisor for this thesis, and to Mr. James

Nickum, Project Engineer at Avionics Engineering Center, for their help throughout this work. Special thanks are due to Drs. Hugh

Bloemer, Department of Geography, Roger Radcliff and Herman Hill,

Department of Electrical and Computer Engineering at Ohio University who served on the defense committee, for their advice and suggestions.

The author would like to thank Mr. David Quinet, Graduate Assistant, whose help proved invaluable in getting the receiver ready for flight tests. Finally, the author would like to extend his appreciation to

Ms. Alicya Shade, Ms. Michele Nutter, Mr. Andrew Ng, Mr. Keith Rudge, and Mr. Eugene Gagliano for the production of this document. IX. REFERENCES

[l] Bowditch, N; "American Practical Navigator," Defense Mapping Agency Hydrographic Center, 1977.

[2] Kayton, Myron and Walter R. Fried, "Avionics Navigation Systems," John Willey and Sons, Inc., New York, NY., 1969. [3] Ibid., Kayton and Fried.

[4] Ibid., Kayton and Fried.

Is1 "Loran-C User Handbook," COMDINST MI6562.3, Department of Transportation, U.S. Coast Guard, May, 1980.

161 Ibid., U.S. Coast Guard.

[8] Hogle, L; Markin, K; Toth, S;, "Evaluation of Various Navigation System Concepts," prepared for Department of Transportation, Federal Aviation Administration, Report No. FAA-EM-82- 15.

[9] Noe, Philip S., and Myers, Kenneth A,, "A Position Fixing Algorithm for Low Cost GPS Receiver," IEEE Trans. Aerospace and Electronic Systems1, Vol. AES-12, No. 2, March, 1976.

[lo] Kruh, P., Brady, W.F., and Schmitt, D.L., "A Strategy for Buildup to the Operation of NAVSTAR GPS Constellation," Institute of Navigation, National Aerospace Meeting, Arlington, Virginia, March 22-25, 1983.

[ll] "Advisory Circular," Department of Transportation/Federal Aviation Administration, AC 90-45A, February, 1975.

[12] Op. cit., Kayton and Fried.

[13] Fabiano, E.B., W.J. Jones, N.W. Peddie, "The Magnetic Charts of the United States for 1975," United States Geological Survey, Circular No. 810.

[14] Dunlap, G.D., and H.H. Shufeldt, "Duttonls Piloting and Navigation," United States Naval Institute, Annapolis, Maryland, May, 1969.

[15] Ibid., Dutton's Piloting and Navigation.

1161 Op. cit., Bowditch.

[17] Op. cit., Hogle, Markin and Toth. Oguri, Fujiko, "Area Navigation Implementation for Microcomputer Based Loran-C Receiver," M.S. Thesis, Ohio University, Athens, Ohio, June, 1983.

Op. cit., Hogle, Markin and Toth.

Op. cit. , Kayton and Fried.

Op. cit., Duttonls Piloting and Navigation.

Op. cit., Kayton and Fried.

Op. cit., Duttonls Piloting and Navigation.

Op. cit., Fabiano, Jones and Peddie.

Ibid., Fabiano, Jones and Peddie.

Defense Mapping Agency Hydrographic Center, Washington, D.C.

National Geophysical Data Center, Boulder, Colorado.

Op. cit., Fabiano, Jones and Peddie.

Lilley, Robert W. and McCall, Daryl L., "A Loran-C Prototype Navigation Receiver For General Aviation," OU NASA TM-80, Avionics Engineering Center, Ohio University, Athens, Ohio, August, 1981.

Burhans, Ralph W., "A Low-Cost Loran-C Envelope Processor (The Mini-L Loran-C Receiver)," OU NASA TM 57, Avionics Engineering Center, Ohio University, Athens, Ohio, April, 1978.

Lilley, Robert W., "Processor-Controlled Timing Module For Loran-C Receiver," OU NASA TM-90, Avionics Engineering Center, Ohio University, Athens, Ohio, February, 1984.

Ibid., Robert W. Lilley, TM-90.

Yost, S., "Commutated Automatic Gain Control System," OU NASA TM-81, Avionics Engineering Center, Ohio University, Athens, Ohio, November, 1981.

"Super-Jolt Microcomputer," Microcomputer Associates Inc., Cupertino, California.

"Am 9511A Arithmetic Processor," Advanced Micro Devices, Sunnyvale, California, 1976.

Fischer, Joseph P., "A Microcomputer-based Position Updating System For General Aviation Utilizing Loran-C ," OU NASA TM-85, Avionics Engineering Center, Ohio University, Athens, Ohio, May, 1982. [37] "Video Display Module VDM-1," Microcomputer Products Co.

[38] Op. cit., Joseph P. Fischer, TM-85.

[39] Ibid., Joseph P. Fischer, TM-85.

[40] Op. cit., Fujiko Oguri, TM-88.

[41] Ibid., Fujiko Oguri, TM-88.

[42] "Loran-C Simulator," Epsco Inc., Westwood, Massachusetts. APPENDIX A

FORTRAN Listing of Program to Compute Errors

Between Great Circle and Rhumb Line P-ths THIS PKOGRAM COMPUTES THE GKEAT CIRCLE AND RHUMB LINE PATH BETWEEN TWO SPECIFIED WAYPOINTS AND CALCULATES THE MAXIMUM PATH EKKOR BETWEEN THE TWO PATHS. THE PATH ERROR IS COMPUTED USING THE ITERATIVE PROCESS DESCRIBED IN CHAPTER 111. R.KAUL 8/84

DIMENSION ~~~(2010),~~~(2010),~~~(2010),YKD(2010) DIMENSION ~~~(2010),~~~(2010),XRR(2010),YRR(2010) DIMENSION X(200),Y(200),BRNG(10) DIMENSION LPACE~(~O),LPACE~(~O)

READ IN LATITUDE AND LONGITUDE OF WAYPOINT NO. 1 AND 2 THE FILE DEFINITIONS MAY BE SPECIFIED BY USER.

CALL RDLL(DLA~,DLOL,LPACE~) CALL RDLL(DLA2,DL02,LPACE2) PI=ARCOS(-1 .O) RLAl=DLAl*PI/ 180 .O RLA2=DLA2*PI/180.0 RLol=DLol*PIll8o.O RLO2=DL02*~1/180.0 PHIR=(RLA~+RLA~)/~.O RLO=(RL02-RL01) DLO= ( DL02-DLO1) RHUMB LINE CALCULATIONS

GREAT CIRCLE CALCULATIONS

CALCULATIONS ON TRACK AINC=RLO/SOO.O DO 1 I=1,501 XGR(I)=RLO~+AINC*(FLOAT(I-1)) DLOX=- ( RLO 1-XGR( I) ) XRR( I)=XGR( I) YGR(I)=ATAN(TAN(VERT)*COS(XGR(I)-RLOI-DLOV)) YRR(I)=RLA~+DLOX*COS(PHIR)*TAN(BEAR) CONTINUE DO 30 I=1,501 xGD(I)=~~O.O/PI*XGR(I) yG~(I>=180.O/PI*YGK( I) xRD(I)=~~O.O/PI*XRR(I) YRp(I)=180.O/PI*YRR(I) A3=ABS(YGD(I)-YRD(1)) CONTINUE CALL TRK(XGD,YGD,XRD,YRD,DLAl ,DL01 ,DLA~,DLO~,,DLOV) STOP END

THIS SUBROUTINE READS IN THE LATITUDE AND LONGITUDE OF ONE WAYPOINT. FILE DEFINITIONS MAY BE DEFINED BY USER.

SUBROUTINE RDLL(ALAT,ALON,LPACE) DIMENSION LPACE(20) DATA MSG1/'LATI1/ ,MSG2/'TUDE1/ ,MSG~/'LONG'/,MSG~/'I'/ DATA QUIT/ ' QUIT' / WRITE(14,6) FORMAT( lX, 'TYPE LPACE 20 CHARACTERS EXACT OR QUIT AND 16 BLANKSf/) READ(13,5) (LPACE(I),I=~,~) FORMAT ( 5A4) IF(LPACE( 1 ) .EQ .QUIT) STOP WRITE( 14,l) MSG1 ,MSG2 FORMAT(lX,'TYPE',1X,2A4,1XytAS DDDD MM SS.SS '1) KEAD(13,2) LDEG,MIN,SEC FORMAT(I4,1X,I2,1X,F5.2) IF(IDEG.LT.O) m~=-MIN IF( IDEG.LT.O) SEC=-SEC ALAT=FL~AT(IDEG)+((FLOAT(MIN)+SEC/~O.O)/~O.O) WRITE( 14,3) MSG3 ,MSG4 ,MSG2 FORMAT(lX,'TYPE' ,lX,A4,Al,A4,lXy'AS DDDD MM SS.SS1/) READ( 13,4) LODEG ,LOMIN,SECLO FOKMAT(I4 ,lXYI2,1X,F5.2) IF(LODEG.LT.O) LOMIN=-LOMIN IF(LODEG .LT. O) SECLO=-SECLO ALON=FL~AT(L~DEG)+((FLOAT(LOMIN)+SECL~/~O.O)/~O.O) RETURN END THIS SUBROUTINE COMPUTES THE MAXIMUM TRACK EKKOK BETWEEN THE GREAT CIRCLE AND RHUMB LINE PATHS USING THE ITERATIVE PROCESS SUBKOUTINE TXK(XGD,YGD,XW,YRD,DLA~,DLO~,DLA~,DLO~,BEAR,CTE~,VERT & ,DLOV) DIMENSION XGD(2010),YGD(2010),XRD(2010),YR~(2010) DIMENSION XGK(2010),YGR(2010),X~(2010),YR~(2010) DIFF=O .O PI=ARCOS(-1.0) B=BEAR+PI/2.0 I= 1 2 A3=ABS(YGD(I)-YRD(1)) IF(AsS(YGD(1)-YW(I)).GT.DIFF) GO TO 1 I=I+1 IF(I.GT.501) GO TO 3 GO TO 2 1 DIFF=ABS(YGD( I)-YRu( I) ) RLLO=XRD(I) RLLA=YRD ( I) GCLA=YGD( I) I=I+l IF(I.GT.501) GO TO 3 GO TO 2 3 GCLO=RLLO U=ULA+(GCLO-RLLO)*COS((GCLA+~LA)*PI/(2.0*18O.O))*TAN(B) V=ATAN(TAN(VERT)*COS(((GCLO-DLO~)*PI/~~~.O)-DLOV))*~~O.O/PI GCLA=V s=u-v Sl=S/ABS( S) MP=BEAR/ABS (BEAR) Al=GCLO DO 10 I=1,50 7 Al=GCLO GCLO=GCLO-MP*DIFF/FLOAT(I) U=ULA+(GCLO-RLLO)*COS((GCLA+ULA)*PI/(2.0*18O.O))*TAN(B) V=ATAN(TAN(VERT)*COS(((GCLO-DLO~)*PI/~~~.O)-DLOV))*~~O.O/PI GCLA=V s=u-v WRITE(14,29) I,U,V,GCLO,S ,DIFF 29 FORMAT(lX,I6,5FlO.6) S2=(U-V)/AsS(U-V) IF(ABS(S) .LE.0.001) GO TO 5 IF(DIFP.GT.l.O.AND.ABS(S).LE.O.Ol) GO TO 5 IP(Sl.NE.S2) GO TO 6 GO TO 10 6 GCLO=Al 10 CONTINUE 5 GCLA=U CTERR=~~.~*SQRT((GCLA-RLLA)**~+(COS((~GCLA)/~.O*PI/~~O.O)* C(GCL0-RLLO))**2) RETURN END APPENDIX B

FORTRAN Listing of MAGVAR Program THIS PROGRAM COMPUTES THE MAGNETIC VARIATION AS A FUNCTION OF LATITUDE AND LONGITUDE. THE SECULAR CHANGE IS ALSO CALCULATED. IT IS BASED ON THE USD 80 POLYNOMIAL MODEL DEVELOPED BY FABIAN0 AND OTHERS AT THE UNITED STATES GEOLOGICAL SURVEY IN DENVER CO. PLEASE CONSULT USGS CIRCULAR N0.810 FOR DETAILS. WAN KAUL - 3/84

THE INPUT VARIABLES ARE ALAT,ALON AND YEAR REPRESENTING LATITUDE, LONGITUDE AND YEAR. VARIABLES A AND A1 ARE THE COEFFICIENTS TO BE READ

DIMENSION A(8,8) ,A1 (8,8) DATA EAST/'EAST1/,WEST/'WEST'/

READ LATITUDE AND LONGITUDE

MRITE(6,9) FOKMAT(lX,'TYPE LAT. AND LONG. AS NNN.NN NNN.NN (F6.2,1X,F6.2) ') READ(7,8) ALAT ,ALON FORMAT(F6.2,1X,F6.2)

DETERMINE WHICH BAND THE POINT IS IN TO LOAD CORRECT SET OF COEFFICIENTS CORRESPONDING TO PARTICULAR BAND.

READ NORMALIZED LONGITUDE FOR PARTICULAR BAND AND THE COEFFICIENTS.

READ(K,7) DLON FORMAT(F6.2) DO 5 NN=1,8 DO 6 II=l,NN KEAD(K,3 ,END=13) A(NN,II) FORCUT(E12.5) CONTINUE CONTINUE

DEFINE COLATITUDE AND NORMALIZED EAST LONGITUDE

INITIALIZE MAGNETIC VARIATION AND PERFORM CALCULATION DO 1 N=1,8 DO 2 I=l,N KK=IABS(N-I) JJ=IABS(I-1) DL=DLO-DLON IP(DL.EQ.O.0) DLz360.0 AK=AK+(A(N,I)*((DLA-52,01)**KK)"((DL)**JJ)) CONTINUE CONTINUE

KEAD COEFFICIENTS FOR SECULAR CHANGE CALCULATION

DO 15 NN=1,7 DO 16 11-1 ,NN KEAD(16,23 ,END=14) Al(NN,II) FOKMAT(E12.5) CONTINUE CONTINUE

DEFINE COLATITUDE AND NORMALIZED EAST LONGITUDE

INITIALIZE SECULAR CHANGE AND PERFORM CALCULATION sv=o.o DO 11 N=1,7 DO 12 I=l,N KK=IABS(N-I) JJ=IABS(I-1) DL-DLO-DLON IF(DL.EQ.O.O) DL=~~O.O SV=SV+(A(N,I)*((DLA-52.01)**KK)*((DL)**JJ)) CONTINUE CONTINUE

READ YEAR

WRITE(6,17) FORMAT(5X,'TYPE YEAR AS NN.N (F4.1) E.G. JUN 84 = 84.5') READ(7,18) YEAR FOWT(F4.1)

COMPUTE SECULAR VARIATION ANNUAL AND TO PRESENT DATE. ALSO COMPUTE MAGNETIC VARIATION V=ABS (VAK) WRITE(6,4) ALAT,ALON,V,DIK,SS 4 FORMAT(5X,'LATITUDE = ',F~.~/,~x,'LoNGITUDE= ',F~.~/,~x,'MAGNETIC & VARIATION = ',F~.~,~x,A~/,~x,'sECULARCHANGE (ANNUAL) = ',F6.2) STOP END APPENDIX C

Coefficients for the 5 Bands and Secular Variation

Used by MAGVAR The coefficients (a for the magnetic variation in the conterminous United Staces (5 bands). j

Band 1 Band 2 Band 3 Band 4 Band 5 The coefficients (a ) for the secular change in the cot48 region. ij APPENDIX D

Assembly Language Listing of RLCALC SUBROUTINE...... RLCALC * * THIS PROGRAM IS CALLED BY RNAV TO COMPUTE RHUMBLINE INFORMATION * AND MAGNETIC VARIATION FOR LORAN-C. THE MATHEMATICAL mDEL USED * WAS OBTAINED FROM BOWDITCH AND IS ALSO USED IN REPORT BY HOGLE. * THIS VERSION WAS BLOWN INTO EPROMS ON 7/12/84 - R. KAUL * ...... * * SCRATCHPAD RAM LOCATIONS ARE AT $0100 FOR ALL VARIABLES * USED IN THIS PROGRAM. THE VARIABLES USE 4 BYTES EACH TO BE * COMPATIABLE WITH THE 9511 FLOATING POINT FORMAT. * ORG $70 VY BSS 1 LOCATION FOR VIDEO DISPLAY ORG $A8 BASE BSS 2 BASE ADDRESS OF SCRATCHPAD RAM VIDEO BSS 2 BASE ADDRESS OF VIDEO DISPLAY BOARD ORG $56 CTRN BSS 1 COUNTEK FOR OUTER LOOP IN LEAST SQUARES ALGOTITH CTRI BSS 1 COUTNEK FOR INNER LOOP IN LEAST SQUARES ALGORITH COFCTR BSS 1 COUNTER TO POINT AT THE RIGHT COEFFICIENT TO BE * USED IN LEAST SQUARES ALGORITHM COFTAB BSS 2 ADDRESS OF COEFFICIENT TABLE MTEMP BSS 1 TEMPORARY LOCATION USED BY MAGVAR CALCULATION. MTEMP1 BSS 1 USED BY MAGVAR MAGCTR BSS 1 COUNTER TO COMPUTE MAGVAR EVERY 255 LOOPS. * * EQUATES TO SUBROUTINE CALLS * PUSH EQU $28AA SUBROUTINE TO PUSH NUMBER ON TO 9511 STACK - 4 B POP EQU $28DA SUBROUTINE TO POP NUMBER FROM 9511 STACK - 4 BYT CMND EQU $2906 SUBROUTINE TO ISSUE COMMAND TO 951 1 TO PERFORM 0 RNGB* EQU $29DF SUBROUTINE TO WRITE NUMBER TO DISPLAY BASE MUST * EQUATES TO VARIABLE ADDRESSES USED IN RNAV * PHGS EQU $EO THGS EQU $DC LA1 EQU $44 LO1 EQU$40 LA2 EQU $4C LO2 EQU $48 TWO EQU $28 P18 EQU $2C C60 EQU$6C F270 EQU $20 PA12 EQU $30 F90 EQU $24 * M9511A COMMANDS. * PWR EQU SOB FADD EQU $10 FSUB EQU $11 FMUL EQU $12 F'DIV EQU $13 SQRT EQU 1 SIN EQU 2 COS EQU 3 ATAN EQU 7 PTOF EQU $17 PUP1 EQU$lA FLTD EQU $1C FIXD EQU $1E CHSF EQU $15 TAN EQU $04 XCHF EQU $19 ASIN EQU $05 DMUL EQU $2E * RHUMB LINE CONSTANTS AND VARIABLES BAND EQU $0 ADDR FOK NORMALIZED LONGITUDE FOR PARTICULAR BAN * FOLLOWED BY 36 CO-EFFICIENTS FOR EACH BAND AT LOCATION * $3800 TO $3CFF - ONE PAGE FOR EACH OF 5 BANDS. * * * CONSTANTS FOK DIVISION IN LEAST SQUARES ALGORITHM FOK MAGVAR. * MZERO EQU $0 -0.0 MONE EQU MZERW4 - 1.0 mW0 EQU MONE+4 -2 .O MTHREE EQU MTWW4 -3 -0 MFOUR EQU WHREE+4 -4.0 MFIVE EQU MFOUR+4 -5 -0 MsIX EQU MFIVE+4 -6 -0 MSEVEN EQU MSIX+4 -7 -0 * * CONSTANTS THAT DEFINE LIMITS IN BANDS OF COT48 TO DETEKMINE * WHICH SET OF CO-EFFICIENTS NEED TO BE USED IN THE ALGORITHM * TO DETERMINE MAGNETIC VARIATION. * A78 EQU MSEVEN+4 A90 EQU A78+4 A102 EQU A90+4 A1 14 EQU A102+4 A5201 EQU A114+4 NOKMALIZED LATITUDE = 52.01*PI/180 RADIANS F180 EQU A5201+4 ATEMP EQU F180+4 TEMPORARY LOCATION USED WHILE DETERMINING THE PA NDL EQU ATEMP+4 MDLO-NORMALIZED LONGITUDE FOR PARTICULAR BAND. MDLA EQU NDL+4 ~112-PHGS (RADIANS) MDLO EQU MDLA+4 2*PI-THGS (RADIANS) MDLA52 EQU MDLW4 MDLA-A5 201 MAGVAR EQU MDLA52+4 MAGNETIC VARIATION PHIR EQU MAGVARt.4 MID-LATITUDE (RLAl+RLA2)/2 DL0 EQU PHIR+4 DIFFERENCE IN LONGITUDE DEGREES RLO EQU DLW4 DIFFERENCE IN LONGITUDE RADIANS &A EQU RLW4 DIFFEKENCE IN LATITUDE RADIANS RLTEMP EQU RLA+4 TEMPERORY LOCATION RLDIST EQU RLTEMP+4 RHUMB LINE DISTANCE LOCATION BEAR EQU RLDIST+4 RHUMB LINE BEARING LOCATION BEAR1 EQU BEAR+4 BEARING FROM WP1 TO WP2 MAGVD EQU BEAR1+4 MAGNETIC VARIATION (CUMULATIVE) RLCTEB EQU MAGVM-4 CROSS TUCK ERROR (BEARING) *RLCTE EQU RLCTEB+4 CROSSTRACKERRORIN NAUTICAL MILES * ORG $3000 * RHUMB LINE DISTANCE * * CALCULATE 'PHIK' * LDA =2 STA BASE+l BASE= $0200 LDY =PHGS RECEIVEK LATITUDE JSR PUSH INC BASE+l BASE= $0300 LDY =LA2 WAYPOINT 2 LATITUDE JSR PUSH LDA =FADD JSR CMND PHGS+LA2 LDY =TWO JSR PUSH LDA =FDIV JSR CMND DEC BASE+l DEC BASE+l BASE= $0100 LDY =PHIR * JSR POP pHIR=(pHGS+LA2)/2 * CALCULATE 'RLO', 'DLO' AND 'RLA'. * INC BASE+l INC BASE+l BASE= $0300 LDY =LO2 WAYPOINT 2 LONG. JSR PUSH DEC BASE+l BASE= $0200 LDY =THGS RECEIVER LONG. JSR PUSH DEC BASE+l BASE= $0100 LDA =FSUB JSK CMND LDY =RLO RLO-L02-THGS JSR POP LDY =RLO JSR PUSH INC BASE+l INC RASE+l BASE- $0300 LDY =P 18 JSR PUSH LDA =FMUL JSR CMND DEC BASE+l DEC BASE+l BASE= $0100 LDY =DL0 DLO=RL0*180.0 JSR POP INC RASE+l BASE= $0200 LDY =PHGS JSR PUSH INC BASE+l BASE= $0300 LDY =LA2 JSK PUSH LDA =FSUB JSR CMND DEC BASE+l DEC BASE+l BASE=$0100 LDY =&A RLA=PHGS-LA2 * JSR POP * CALCULATE ' KLDIST ' * LDY =PHIR JSR PUSH LDA =COS JSR CMND COS ( PHIR) LDY =RLO JSK PUSH LDA =FMUL JSK CMND RLO*COS(PHIR) LDY ==TEMP JSR POP RLTEMP=RLO*COS(PHIR) LDY =RLTEMP JSR PUSH LDY =&TEMP JSR PUSH LDA =FMUL JSR CMND LDY =&TEMP JSR POP RLTEMP=(RLO*COS(PHIR) )** 2 LDY =RLA JSK PUSH LDY =&A JSR PUSH LDA =FMUL JSR CMND RLA**2 LDY =&TEMP JSR PUSH LDA =FADD JSR CMND LDA =SQRT JSK CMND INC BASE+l BASE= $0200 LDY =C60 JSR PUSH LDA =FMUL JSR CMND INC BASE+l BASE= $0300 LDY =P 18 JSR PUSH LDA =FMUL JSR CMND DEC BASE+l DEC BASE+l BASE= $0100 LDY =RLD I ST RLDIST=~~*SQRT(RLA**~~-~O*COS(PHIR))*~~O/PI * JSR POP * * CALCULATE RHUMB LINE BEARING * LDY =RLA JSR PUSH LDY =PHIR JSR PUSH LDA =COS JSR CMND LDY =RLO JSK PUSH LDA =FMUL JSR CMND LDA =FDIV JSR CMND LDA =ATAN JSR CMND LDY =BEAR BEAR=ATAN(RLA/RLO*COS(PHIR)) JSR POP LDY =BEAR LDA (BASE),Y BPL A2 JSR PUSH LDA =CHSF CHANGE SIGN IF NEGATIVE JSR CMND LDY =BEAR * JSR POP A2 LDY =RLA LDA (BASE),Y * BPL A3 LDY =RLO LDA (BASE) ,Y SPL A4 JMP A7

LDY =RLO LDA (BASE) ,Y BPL A6 JMF' A5

LDY =F270 LDA =FSUB JMP A8

LDY =F270 LDA =FADD JMP A8

LDY =F90 LDA =FADD JMP A8 LDY =F90 LDA =FSUB

PHA INC BASE+l INC BASE+l BASE= $0300 JSR PUSH DEC BASE+l DEC BASE+l BASE= $0100 LDY =BEAR JSR PUSH PLA JSR CMND LDY =BEAR JSR POP

LDY =BEAK JSR PUSH INC BASE+l INC BASE+l BASE= $0300 LDY =P 18 JSR PUSH LDA =FMUL JSR CMND DEC BASE+l DEC BASE+l BASE= $0100 LDY =MAGVD ADJUST FOR MAGNETIC VARIATION JSR PUSH LDA =FSUB JSK 0 LDY =BEAR JSR POP LDY =RLDIST LDA (BASE) ,Y IF KLDIST IS NEGATIVE, CHANGE SIGN. BPL A1 JSR PUSH LDA =CHSF JSR CMND LDY =RLDIST JSR POP

DISPLAY RHUMB LINE DISTANCE AND BEARING

LDA =$A0 STA VIDEOtl LDY =RLDIST JSR PUSH INC BASE+l BASE=$200 LDX =66 LOCATION (BYTE BUCKET) FOR RLDIST. (DUMMY AT $EO LDA =$B7 VIDEO LOCATION FOR RZDIST STA VY JSR RNGB

DEC BASE+l BASE= $0100 LDY =BEAR JSR PUSH INC BASE+l BASE= $0200 LDX =04 LOCAT ION (BYTE BUCKET) FOR BEARING. LDA =SF7 STA VY JSR RNGB INC VIDE0-t-1 INC BASE+l BASE = $0300

CALCULATE MAGVAK EVERY TIME MAGCTR IS SET TO ZERO.

LDA MAGCTR BEQ BO JMP B1 MOVE CONSTAIJT NUMBER TABLE IN SCRATCH SPACE

DEC BASE+l DEC BASE+l BASE = $0100 LDA =O LDY -0 LDA TABLE1 ,Y STA (BASE) ,Y INY CPY =56 BNE MO

LDY =MZERO JSK PUSH LDY =MAGVAR JSR POP SET INITIAL VALUE OF MAGVAR TO ZERO. MAGNETIC VARIATION CALCULATION

LDA =O STA CllRN STA CTKI INITIALIZE COUNTER

CALCULATE MDLA

INC BASE+l INC BASE+l LDY =F90 JSR PUSH DEC BASE+l BASE = $0200 LDY =PHGS JSR PUSH LDA =FSUB JSR CMND DEC BASE+l BASE = $0100 INC BASE+l INC BASE+l LDY =P18 JSR PUSH LDA =FMUL JSK CMND DEC BASE+l DEC BASE+l LDY =MDLA MDLA = PI/2-PHGS JSR POP

CALCULATE MDLO

INC BASE+l INC BASE+l BASE = $0300 LDY =PA12 JSK PUSH DEC BASE+l BASE = $0200 LDY =THGS JSR PUSH LDA =FSUB JSR CMND DEC BASE+l BASE = $0100 INC BASE+l INC BASE+l LDY =PI8 JSR PUSH LDA =FNL JSK CMND DEC BASE+l DEC BASE+l LDY =MDLO JSR POP MDLO = 2*PI-THGS

CALCULATE MDLA52

LDY =MDLA JSR PUSH LDY =A520 1 JSK PUSH LDA =FSUB JSR CMND LDY =MDLA5 2 JSR POP MDLA52 = MDLA-52.01*PI/180

INC BASE+l BASE = $0200 LDY =THGS JSR PUSH DEC BASE+l BASE = $0100 LDY ==TEMP JSK POP PUT THGS IN RLTEMP FOR COMPARISION PURPOSES IN T HE NEXT SEGMENT TO DETEKMINE WHICH BAND TO USE TO CALCULATE MAGVAR.

DETERMINE WHICH BAND IT IS TO CALCULATE MAGVAR.

LDY =A7 8 JSR PUSH LDY =£&TEMP JSK PUSH LDA =FSUB JSR CMND LDY =ATEMP JSR POP ATEMP = 78*PI/180 - THGS LDY =ATEMP LDA (BASE),Y BPL M1 IF ATEMP IS +VE - BAND 1, IF NOT TKY FOK BAND 2

LDY =A9 0 JSR PUSH LDY =RLTEMP JSK PUSH LDA =FSUB JSK CMND LDY =ATEMP JSK POP ATEMP = 90*~1/180 - THGS LDY =ATEMP LDA (BASE),Y BPL M.2 IF ATEMP IS +VE - BAND 2, IF NOT TKY FOR BAND 3

LDY =A1 0 2 JSR PUSH LDY ==TEMP JSK PUSH LDA =FSUB JSR CMND LDY =ATEMP JSK POP ATEMP = 102*PI/180 - THGS LDY =ATEMP LDA (BASE),Y BPL M3 IF ATEMP IS +VE - BAND 3, IF NOT TKY BAND 4

LDY =A1 14 JSR PUSH LDY =&TEMP JSR PUSH LDA =FSUB JSR CMND LDY =ATEMP JSR POP ATEMP = 114*PI/180 - THGS LDY =ATEMP LDA (BASE) ,Y BPL M4 IF ATEMP IS +VE - BAND 4 JMP M5 MUST BE BAND 5

SET CO-EFFICIENT TABLE ADDRESS TO CORRESPOND WITH PARTICULAR BAND

LDY =MDLO JSR PUSH LDA =$38 STA BASE+l STA COFTAB+l BAND 1 JMI? M6

LDY =MDLO JSR PUSH LDA =$39 STA BASE+l STA COFTAW-1 BAND 2 JMP M6

LDY =MDLO JSK PUSH LDA =$3A STA i3ASE+1 STA C0FTAB-I-1 BAND 3 JMP M6

LDY =MDLO JSR PUSH LDA =$3B STA BASE+l STA COFTAB+l BAND 4 JMP M6 M5 LDY =MDLO JSR PUSH LDA =$3C STA BASE+l STA COFTAB+l BAND 5 * M6 LDA =O STA COFTAB LDY =BAND JSR PUSH LDA =FSUB JSR WD LDA =1 STA BASE+l BASE = $0100 LDY =NDL JSB POP NDL=MDLO-NOKMALIZED LONGITUDE FOR PARTICULAR BAN LDA -4 STA COFCTK SET CO-EFFICIENT COUNTEK TO POINT TO CO-EFFICIEN C2 CLC LDA CTRN LOAD OUTER LOOP COUNTEK ROL A ROL A POINT TO LOCATION FOR EXPONENTS FOR LEAST SQUARE STA MTEMP LDY MTEMP JSR PUSH LDA CTRI LOAD INNER LOOP COUNTEK ROL A ROL A POINT TO LOCATION FOR EXPONENTS STA MTEMP LDY MTEMP JSK PUSH LDA =FSUB JSR CMND LDY =RLTEMP JSR POP LDY =MDLA5 2 JSK PUSH LDY =MDLA5 2 LDA (BASE) ,Y BPL C6 LDA =1 STA MTEMP1 LDA =CHSF JSR CMND JMF' C9 C6 LDA =O STA MTEMPl C9 LDY =RLTEMP JSK PUSH LDA =PWR JSK CMND CL C LDA CXRN SBC CTRI AND -1 BNE C4 LDA mEMP1 BEQ C4 LDA =CHSF JSR CMND C4 LDY =ATE@ JSR POP CL C LDA CTRI LOAD INNER LOOP COUNTER FOR LEAST SQUARES PROCED ROL A ROL A POINT TO ' LOCATION FOR EXPONENTS STA MI'EMP LDY MTEMP JSR PUSH LDY =&TEMP JSR POP LDY =NDL JSK PUSH LDY =NDL LDA (BASE),Y BPL C7 LDA =O STA MI'EMP1 LDA =CHSF JSR CMND JMP C8 C7 LDA =1 STA MTEMPl C8 LDY =KLTEMJ? JSR PUSH LDA =PWR JSR CMND NDL**I LDA CTRI AND =1 BEQ C5 LDA MTEMP1 BNE C5 LDA =CHSF JSR CMND C 5 LDY =ATEMP JSR PUSH LDA =FMUL JSR CMND LDA COFTAB+l STA BASE+l PUT CO-EFFICIENT TABLE ADDRESS IN BASE LDY COFCTR POINT TO CO-EFFICIENT COUNTEK JSR PUSH LDA =FNL JSK CMND A(NI)*NDL**(I) LDA -1 STA BASE+l BASE = $0100 LDY =MAGVAR JSR PUSH LDA =FLUID JSR CMND LDA =PTOF JSR CMND LDY =MAGVAR JSR POP LDA =$CD STA BASE+l LDY COFCTR JSR POP LDA =1 STA BASE+l INC COFCTK INC COFCTR INC COFCTR INC COFCTR POINT TO NEXT SET OF CO-EFFICIENTS LDA CTRN CMP CTKI BEQ C1 IF THEY ARE EQUAL INNER LOOP DONE, CHECK IF OUTE INC CTKI JMP C2 IF NOT, GO BACK AND COMPLETE OUTER LOOP C1 LDA CXRN CHECK TO SEE IF OUTEK LOOP COMPLETE CMP -7 BEQ C3 OUTER LOOP ALSO DONE, BRANCH OUT INC CTRN INCREMENT OUTEK LOOP COUNTER LDA =O STA CTKI INITIALIZE INNER LOOP COUNTER * JMP C2 START OVER C3 LDY =MAGVAR LDA (BASE),Y BPL C10 JSR PUSH LDA =CHSF JSK CMND LDY = MAGV D JSR POP LDA ~$57 STA $AlAE JMP C11 C10 JSR PUSH LDY =MAGVD JSR POP LDA =$45 STA $AlAE C11 LDA =$A1 STA VIDEW1 LDY =MAGVD JSK PUSH INC BASE+l BASE = $0200 LDX =6 LOCATION (BYTE BUCKET) FOR MAGVAR. LDA =$A8 VIDEO BOARD LOCATION FOK MAGVAK. STA VY JSK RNGB

RLCTEB CALCULATION

CALCULATE 'PHIR'

INC MAGCTR LDA =3 STA BASE+l BASE= $0200 LDY =LA1 RECEIVER LATITUDE JSK PUSH LDY =LA2 WAYPOINT 2 LATITUDE JSR PUSH LDA =FADD JSR CMND LAl+LA2 LDY =TWO JSR PUSH LDA =FDIV JSR CMND DEC BASE+l DEC BASE+l BASE= $0100 LDY =PHIR JSR POP PHIR=(LAl+LA2) / 2

CALCULATE 'iUO1, 'DLO' AND 'RLA'.

INC BASE+l INC BASE+l BASE= $0300 LDY =LO2 WAYPOINT 2 LONG. JSR PUSH LDY =LO 1 RECEIVER LONG. JSR PUSH DEC BASE+l DEC BASE+l BASE= $0100 LDA =FSUB JSR CMND LDY =RLO RLO=LO2-LO1 JSK POP LDY =RLO JSR PUSH INC BASES1 INC BASE+l BASE= $0300 LDY =P 18 JSR PUSH LDA =FMUL JSR CMND DEC BASE+l DEC BASE+l BASE= $0100 LDY =DL0 DLO=RL0*180.0 JSK POP INC BASE+l INC BASE+l BASE= $0300 LDY =LA1 JSR PUSH LDY =LA2 JSR PUSH LDA =FSUB JSR CMND DEC BASE+l DEC BASE+l BASE=$0100 LDY =RLA RLA=LAl -LA2 * JSR POP * * * CALCULATE RHUMB LINE BEARING * LDY =RLA JSR PUSH LDY =PHIR JSR PUSH LDA =COS JSR CMND LDY =RLO JSR PUSH LDA =FMUL JSR CMND LDA =FDIV JSR CMND LDA =ATAN JSR CMND LDY =BEAR1 BEAR~=ATAN(RLA/RLO*COS(PHIK)) JSR POP LDY =BEAR1 LDA (BASE),Y BPL D2 JSR PUSH LDA =CHSP CHANGE SIGN IF NEGATIVE JSR CMND LDY =BEAR1 * JSR POP D2 LDY =&A LDA (BASE),Y BPL D3 LDY =uo LDA (BASE) ,Y BPL D4 JMP D7

LDY =RLO LDA (BASE) ,Y BPL D6 JMP D5

LDY =F270 LDA =FSUB JMP D8

LDY =F270 LDA =FADD JMP D8

LDY =F90 LDA =FADD

JMP D8

LDY =F90 LDA =FSUB PHA INC BASE+l INC BASE+l BASE= $0300 JSR PUSH DEC BASE+l DEC BASE+l BASE= $0100 LDY =BEAR1 JSK PUSH PLA JSR CMND LDY =BEAR1 JSR POP

LDY =BEAR1 JSK PUSH INC BASE+l INC BASE+l BASE= $0300 LDY =PI8 JSR PUSH LDA =FMUL JSK CMND DEC BASE+l DEC BASE+l BASE= $0100 LDY =MAGVD ADJUST FOR MAGNETIC VARIATION JSR PUSH LDA =FSUB JSR CMND LDY =BEAR1 JSR POP LDY =BEAR JSK PUSH LDY =BEAR1 JSK PUSH LDA =FSUB JSR CMND LDY =RLCTEB * JSK POP * DISPLAY RLCTEB * LDY =KLCTEB LDA (BASE) ,Y BPL D9 JSR PUSH LDA =CHSF JSR CMND LDY =RLCTEB JSK POP D9 LDY =RLCTEB JSR PUSH INC BASE+l BASE= $0200 LDX =66 LDA =$77 STA VY * JSR RNGB * RLCTE CALCULATION * DEC BASE+l BASE = $0100 LDY =KLCTEB JSR PUSH LDY =F180 JSR PUSH LDA =FMUL JSR CMND LDA =SIN JSR CMND LDY =RLD I ST JSK PUSH LDA =FMUL JSK CMND LDY =RL CTE * JSR POP * DISPLAY RLCTE * LDY =UCTE JSK PUSH INC BASE+l LDX -8 LOCATION (BYTE BUCKET) FOR RLCTE LDA =$57 VIDEO BOARD LOCATION FOR RLCTE. STA VY JSR RNGB LDA =3 STA BASE+l * RT S * TABLE OF CONSTANTS USED BY MAGNETIC VARIATION STORED * STARTING AT $0100 IN SCRATCHPAD RAM LOCATION. * TABLE1 HEX 00,00,00,00 - 0 -0 (MZEKO) HEX 01,80,00,00 - 1.0 (MONE) HEX 02,80,00,00 - 2.0 (MTWO) HEX 02,C0,00,00 - 3.0 (MTHREE) HEX 03,80,00,00 - 4.0 (MFOUR) HEX 03,A0,00,00 - 5.0 (MFIVE) HEX 03,C0,00,00 - 6.0 (MSIX) HEX 03 ,EO ,00,00 - 7.0 (MSEVEN) HEX 01 ,AE ,40 ,FI - 78*~11it30 (~78) HEX 01 ,C9 ,OF,DA - 90*~1/180 (A90) KEX 01,E3,DE,C4 - 102*~1/180 (A102) HEX 01 ,FE ,AD ,AE - 114*PI/ 180 (A1 14) HEX 06,DO ,OA,3D - 52.01*PI/180 (A5201) HEX 7B,8E,FA,35 - PI/180.0 (F180) * * * * CO-EFFICIENTS FOR THE FIVE BANDS OF THE COT48 * THE DATA LABELED BAND(N) IS THE NORMALIZED * LONGITUDE FOR EACH BAND. THE CO-EFFICIENTS * ARE STORED IN ONE PAGE CHUNKS STARTING AT * $3800 TO $3CFF. * ORG $3800 BAND1 HEX 09,90,81,48 - 289.01 HEX 84,C8,B2,96 HEX 7F,F2 ,B6,07 HEX 80,CA,E9,68 HEX FA,F4 ,B3,9C HEX 79,9B,AC,C4 HEX 79 ,EF,5E,07 IIEX 75,97,EB,10 HEX 75 ,F1 ,C0,9A HEX F7 ,C5 ,A5,66 HEX 77 ,A2,06 ,A6 HEX 71 ,D4 ,E9,7F HEX Fl ,F8,7E,E8 HEX F1,97 ,F0,15 HEX 72 ,E7,02,28 HEX 73,83,BO,EB HEX 6A,F8,66,41 HEX EDYCC,F2,4A HEX 6D,BF,FC,83 HEX EF,82,5D,9D HEX 6F,B9,C1 ,F7 HEX FOY80,1E,7A HEX E9 ,86,96,3E HEX 69 ,AB,24,13 HEX 6A,A6 ,DD,20 HEX 69,D2,22,6E HEX 69,F8,29,C8 HEX EC,CC,59 ,1D HEX 67,C6,CDY89 HEX EO ,B9 ,62,17 HEX 61 ,EC,8F,OF HEX E5,EDY7C,38 HEX 64 ,E2 ,F5,2F HEX 66 ,A1,5E,31 HEX 66 ,9DY6A,60 HEX 67 ,C3 ,E7 ,CE HEX 65 ,C2 ,FA,4F ORG $3900 BAND2 HEX 09 ,8A,81 ,48 - 277.01*PI/180 HEX 82,AB,39,97 HEX 7Fy9C,26,DD HEX 80 ,DAy4A,06 HEX FA,C3,82 ,A1 HEX 7B,98,1F,46 HEX 7B,AO ,F5 ,OD HEX 76 ,A9 ,OD ,F8 HEX F6,CO,C6,EB HEX F7 ,D5 ,7C,74 HEX F7 ,8F,48 ,07 HEX 72,85,1D,21 HEX 72 ,C3 ,BC ,D9 HEX F2,D6,1C,5F HEX F3,97,6B,BF HEX F6 ,9F,AC,25 HEX EEY82,A3,89 HEX 6E,B2 ,1F,27 HEX EFYC9,OD,58 HEX EFYC3,E7,79 HEX 72 ,A2,8A,81 HEX 72 ,B9,90,7C HEX E9,A4,31 ,BA HEX E9,86,30,51 HEX 6A,BE,EF,E4 HEX E8,80,E6,8B HEX 6B,85 ,BA,65 HEX 6C,C7 ,98,81 HEX 6F,A3 ,AC,54 HEX 64 ,A9 ,E4 ,CF HEX E5,83 ,D6,58 HEX 67 ,A9 ,F4,1D HEX E6,83 ,D2 ,DF HEX E8,AB,E8,48 HEX 68 ,E2,35 ,A1 HEX EA,E3,72,90 HEX EB ,A1 ,OD ,C3 ORG $3AOO BAND3 HEX 09,84,81,48 - 265.01 HEX 03,D5,58,CD HEX 79 ,F1,19,1D HEX 80,AO ,E9,70 HEX F9 ,F7,84 ,B1 HEX 7B,C1,81,09 HEX FA,AZ ,F3 ,EB HEX 76,97,BB,AF HEX F5,9A,D3,6F HEX 76 ,B7 ,E2 ,A7 HEX 72 ,F5,70,94 HEX 72 ,E3 ,F3,4B HEX 70,A8,OF,lE HEX 73,A2,OE,7C HEX 74,96,03,217 HEX 72 ,E6 ,F3 ,C5 HEX EF,89,69,28 HEX EE ,A8 ,Dl ,DA HEX F0,93,B3,7A HEX F0,89 ,EE ,A5 HEX FO ,EA,E5,68 HEX EF,97 ,C9 ,C6 HEX EA,83,91,11 HEX 67,96,50 ,EE HEX 68,88,95,5F HEX E7 ,ED,2E,8D HEX ED,D2,B5,5A HEX ED,F8,D0,15 HEX EB,D1,56,79 HEX 66,91,88,D2 HEX 65,97,8D,FC HEX 66,85 ,D8,91 HEX El ,CE,OC,45 HEX 69,BE, 20 ,A2 HEX 6A,86,DF,BO HEX 6A,98,99,19 HEX E7,81,8F,35 ORG $3B00 BAND4 HEX 08,FD,02,8F - 253.01 HEX 04 ,DO ,80,9D HEX FE,FF,CE,74 HEX FF,BA,BB,CB HEX 76 ,DC ,64 ,B4 HEX 7B,9C,F5,DA HEX FB,8D,07,85 HEX 74,98,19,1A HEX F7,8C,5B,C3 HEX 75 ,BB,CE,22 HEX F7 ,A3 ,B4,25 HEX 70,E5,42,BA HEX EF ,D6,86,8B HEX 73,E2,D2,E2 HEX F2 ,D3,47 ,EB HEX 72,85,73,91 HEX EC,DC,6C,A8 HEX 6F,C9 ,DD,4E HEX F0,96,BB,67 HEX 6F,DA,9C,74 HEX 6F,C4,OD,19 HEX 71 ,A2 ,4F,2 HEX E7 ,B1 ,OE,7D HEX El,E5,7D,2D HEX E9 ,D8 ,AD ,43 HEX 68 ,F5,00,52 HEX EC,E4,10,69 HEX 6C,A7 ,DC,02 HEX E8 ,C2,84,C6 HEX 63,8B,F8,78 HEX E6,C5,86,8A HEX 67,90,31 ,E7 HEX 62,B0,3B,29 HEX 67 ,ED,DE,Bl HEX E9,C8,6D,A5 HEX 65 ,B3 ,B1,5E HEX E8 ,EC ,36,48 ORG $3COO BAND5 HEX 08,F1,02,8F - 241.01 HEX 04 ,FF ,F4,F1 HEX FF,CE,B2,29 HEX FE ,DO ,F4,95 HEX 7A,89,50 ,CC HEX 79,9B,89 ,C9 HEX F9 ,D5,2C,6D HEX 75 ,BC ,F5,25 HEX ED,E0,20,A4 HEX 74 ,B6,6B,73 HEX 78,96,8C,74 HEX F0,Fl ,E6,21 HEX F2,AA,AC,OF HEX 73 ,B9 ,FF ,23 HEX 71,9C,AD,69 HEX F2 ,D9,31 ,E5 HEX EE ,D7 ,CO ,FO HEX 6E,92,95,4D HEX EA,B3,02,45 HEX FO,E9,1C,DA HEX 71,8A,7C,2A HEX F2,9E,31 ,E4 HEX 67 ,DA,A5,80 HEX 6A,8F,5A,F3 HEX EB,ED,D6,25 HEX 6D,98,6D,AB HEX ED,BD,43,5B HEX EC,B1,2A,FE HEX 6D,92,4C,lD HEX 65,DF,5D,34 HEX E6,82 ,BE ,74 HEX E6,E7,39,BF HEX 69 ,B5 ,FO ,07 HEX E9,95,1D,C7 HEX 67 ,FE,63 ,A2 HEX E9,B8,09,BO HEX 6A,CF,F8,D4 END APPENDIX E

Assembly Language Listing of CDUINP ...... SUBROUTINE CDUINP . * * THIS PKOGRAM ALLOWS WAYPOINTS TO BE ENTERED INTO THE LORAN * AND CHANGED WITHOUT STOPPING THE SOFTWARE TO CHANGE THE LOCATIONS * THE PKOGRAM IS BLOWN INTO A 2716 EPROM AT LOCATION $C800. THE * PHYSICAL LOCATION OF THE EPROM IS ON THE SUPEKJOLT SLOT. * * THE PROGRAM IS PART OF THE INTEKFACE SOFTWARE TO BE IMPLEMENTED * WITH THE CONTROL DISPLAY UNIT (CDU) ONCE THE CDU IS A REALITY. * AT PRESENT THE SOFTWARE ALLOWS THE USER TO ENTER DATA IN A * PARTICULAR FORMAT FROM THE TERM PORT OF THE BYTE BUCKET LOCATED ON * THE MEMORY BOARD. THE ACIA ON THE MEMORY BOARD READS THE DATA * AND STORES THE DATA IN THE WAYPOINT TABLE. FEATUKES ARE INCLUDED * TO USE CHECKSUMS, HOWEVER CANNOT BE IMPLEMENTED UNTIL THE CDU IS * OPERATIONAL. ONCE IMPLEMENTED WITH THE CDU THE SOFTWARE WILL * INCOKPORATE HANDSHAKING SIGNALS TO ELIMINATE POLLING TIME. * AT PRESENT THE HANDSHAKING SOFTWARE IS NOT PROGRAMMED INTO * EPKOMS BUT APPEARS IN THE LISTING. MINOK CHANGES MAY BE NEEDED * AS DEVELOPMENT OF THE CDU STARTS. THE HANDSHAKING LINES USE * CBl ( CDUREADY ) AND CB2 (LREADY) ON THE PIA LOCATED ON THE * 9511 BOARD. THESE LINES ARE AVAILABLE ON THE BACKPLANE OF THE * 9511 BOARD AT SLOTS X AND W RESPECTIVELY. * * BLOCK A REFERS TO THE WAYPOINT BLOCK. AT PKESENT THE PROGRAM * IS CALLED BY RNAV IN THE MAIN LORAN CALCULATIONS AND THE * SOFTWARE CHECKS TO SEE IF DATA IS AVAILABLE ON THE ACIA PORT. * IF SO THE NEXT TEST IS TO SEE IF THE FIRST CHARACTEK IS THE * BLOCK A IDENTIFIER '@'(ASCII - $40). IF SO THE THE SOFTWARE * WAITS FOR 33 CHARACTERS TO BE RECEIVED FROM THE ACIA. DURING * THIS TIME THE INTERRUPT DRIVEN FOREGROUND IS PROCESSED BUT * NOTHING IN THE BACKGROUND IS UPDATED. FAILURE OF THE FIRST TWO * TESTS PROMPTS THE SOFTWARE TO RETURN TO THE MAIN PPKOGEQA. * * THE 33 CHARACTERS TO BE SENT BY THE USEK MUST BE OF THE FOKMAT : * * (WAYPT. NO. 30) (LAT. OF [JAYPT. 391935) (LONG. OF WAYPT. 00821923) * (WAYPT NO. - 40) (LAT. OF WAYPT. 380012) (LONG OF WAYPT. 01022332) * * THE WAYPOINT NUMBERS 30 AND 40 MUST ALWAYS BE THE SAME SINCE * THAT IS HOW THE RNAV SOFTWARE HANDLES THE WAYPOINTS. * THE 33 RD. CHARACTER CAN BE ANY CHARACTER WHICH TELLS THE SOFTWARE * TO START PROCESSING THE NEW WAYPOINTS. * 9600 BAUD IS USED TO TRANSMIT DATA TO THE ACIA. * * K.KAUL - 7-11-84 * ...... * ORG $5E CHKSUM BSS 1 CHARIN BSS 1 CHRCNT BSS 1 POINT BSS 2 AFLAG BSS 1 RKMP BSS1 COUNT BSS 1 ORG $86 PREWP BSS 1 ORG SAC WP BSS 1 PIAB EQU $9002 RESEND EQU $EAEA UCrL EQU SOCOO UDAT EQU $OC01 CTLA EQU $40 ORG $C800 CDUINP LDA =SO0 STA AFLAG CLEAR BLOCK A FLAG *START LDA PIAB+l * AND =$FC SET PIA TO TOGGLE CBl TO TOGGLE ON HI TO LO TRAN * STA PIAH1 * LDA PIAB+l START LDA UCTL AND =$01 BNE AI * BMI AI CDU READY ? -- YES, SEND LREADY JMP EXIT NO, CONTINUE WITH MAIN PROGRAM A1 LDA PIAB CLEAR INTEKRUPT FLAG IN CONTROL REGISTEK LDA PIAB+l AND =%11000111 ORA =%00110000 STA PIAB+l SEND LREADY ON CB2 TO THE CDU. AGAIN LDA UCTL AND =$01 WAIT FOR DATA FROM CDU BEQ AGAIN DATA RECEIVED. LDA UDAT STA CHARIN STOKE RECEIVED BYTE. LDA PIAB+l AND =%11000111 ORA =%00111000 STA PIAB+l SEND LREADY FOR NEXT CHAtlACTEK LDA AFLAG WAS AFLAG SET BNE A2 YES - MUST BE BLOCK A BYTE. LDA CHARIN NO - CHECK FOR BLOCK A IDENTIFIEK. CME' =CTLA BEQ A3 BLOCK A ? YES -- STOKE WCTEK JME' EXIT TEST FOK BLOCK B A3 LDA =$01 STA AFLAG SET BLOCK A FLAG LDA -00 STA POINT LDA =$CO STA POINT+l SET UP BASE ADDRESS FOR RAM STORAGE AREA. LDA =$20 STA CHKCNT SET CHARACTEK COUNT FOK BLOCK A LDY =$00 SET UP BASE ADDRESS POINTER. STY COUNT JMP AI GET NEXT BYTE FROM ACIA A2 LDA CHARIN IF AFLAG WAS SET MUST BE DATA BYTE. CMP =$08 BNE A6 BACKSPACE ? -- NO CARRY ON LDY COUNT CPY =o YES - IS Y POINTEK =O BEQ A7 YES - START OVER DEC COUNT NO - DECKEMENT POINTER. A7 JMP AI A6 LDY COUNT LDA CHARIN STA (POINT) ,Y STORE DATA BYTE CL C ADC CHKSUM COMPUTE CHECKSUM STA CHKSUM INC COUNT INCREMENT POINTER. CPY CHRCNT COMPARE TO CHARACTER COUNT. BNE AI BLOCK A SENT COMPLETLY ? NO GET NEXT BYTE PROM A LDA =$00 YES - CLEAR BLOCK A FLAG STA AFLAG LDA (POINT) ,Y CHECK THE CHECK SUM BYTE CME' CHKSUM AKE THEY THE SAME BEQ A4 YES STORE IN WAYPOINT TABLE k JMP RESEND SEND COMMAND TO KESEND BLOCK A IF CHECKSUMS DON' A4 LDY =$00 LDX =O A5 LDA (POINT) ,Y AND =$OF MASK OFF 4 BITS ASL A ASL A ASL A ASL A STA TEMP STOKE IN TEMPORARY LOCATIONS. INY LDA (POINT) ,Y GET NEXT BYTE AND =$OF CLC ADC TEMP CWiGE FROM TWO BYTE ASCII TO 1 BYTE BCD STA $OOCO,X STOKE NEW WAYPOINTS IN WAYPOINT TABLE. INY INX CPX =$lo BNE A5 LDA =$34 STA WP LDA =O STA PREWP CHANGE WAYPOINT NULBERS TO UPDATE NEW WAYPOINTS. JMP EXIT CARRY ON WITH MAIN PKOGRAM EXIT RTS END