Ada Used for Radio Telescope Control Radio Telescope

Form U129-0394 RADIOTEL.TXT

Ada Information Clearinghouse, 1-800-AdaIC-11 (232-4211), 703/685-1477

Ada Used for Radio Telescope Control

by Ralph Crafts


Helsinki University of Technology operates a 15-meter microwave radio telescope at the Metsahovi Radio Research Station, Kylmala, Finland. The telescope is mounted on altitude and azimuth axes and consists of a paraboloid primary dish and a secondary hyperboloid mirror mounted on struts in the usual Cassegrain fashion. The whole telescope is enclosed in a plastic radome.

The telescope is used both for technically oriented research such as telecommunications studies, and for astronomical observation by several universities in Finland, as well as in international collaborations such as very long baseline interferometry. The mirrors and dome were manufactured by ESSCO Space Systems (USA). The receivers are mostly made in Finland. Observation is usually at millimetric wavelengths (frequencies around 100 GHz).

Software Requirements and Performance

The real-time control programs are written in DEC Ada and run on a MicroVAX II under VMS. There are several different programs for different kinds of observations, e.g., quasar intensity measurement, solar microwave burst monitoring, observation of microwave spectra from interstellar and circumstellar molecular clouds, etc.

The main function of the programs is to compute azimuth and elevation commands for the antenna position servo. This is done at a 10 Hz rate using Ada tasks and delay statements. The actual servo loop is part of the telescope hardware electronics. Data acquisition samples analog voltages at rates from 1 Hz to some 1000 Hz. For the higher rates VMS DMA drivers are used. Ada tasks are used for low-rate sampling, on-line data reduction and calibration, and the user interface.

Earlier control systems at this site used an HP2100 mini with HP BASIC and (later) HP Algol with a home-brewed tasking system. I programmed on both of the earlier systems and participated in the transfer to Ada. In my opinion, Ada was just right for the job. There has been significant reuse and sharing of packages across different programs. The tasking facilities of Ada 83 were sufficient. Most of the hardware twiddling was successfully hidden in packages of in-line routines. Finally, and as has often been reported, most programs that compiled correctly also ran correctly. This was a pleasant change compared to the earlier languages.

In terms of size, this is a small application, created and maintained by a group of one to three programmers and used by 10 to 20 users. For more information on the transition from BASIC and Algol to Ada, you can contact me at the address that appears at the end of this article.

(The following descriptions of two typical programs are by Merja Tornikoski.)

Solar observations

The current Solar observing system SMART (Solar Microwave Activity Research Tool) is able to perform all types of Solar observations normally done at Metsahovi: Solar map measurements, sweeps through the Solar surface, and tracking a certain region on the Sun. SMART is a knowledge system which acts both as an observing program and an expert. The program has knowledge for identifying, classifying, and prioritizing active Solar regions. It uses some basic artificial-intelligence methods to predict the activity development of the regions and to suggest further observing targets. SMART is designed to identify and eliminate problems like inaccurate telescope pointing and varying weather conditions. It also performs the initial data-reduction on-line, even though more profound data reduction is normally done afterwards and on other computers.

The SMART system is actually a collection of several Ada programs which are run by a DCL script. The script calls the different programs when they are needed to (initially) calculate Solar coordinates, measure a Solar map, analyze the map, print a draft of the map, track active regions, etc. Only the programs which analyze maps (old or new) and the observing data are "intelligent", the others just perform routine tasks like moving the telescope, sampling the A/D converter, etc.

Experience has shown that SMART can actually outsmart the more inexperienced observer. For an expert observer, SMART is useful for quickly giving very much information and also giving suggestions for further actions, which one may then take or leave. The program has been in almost daily use since 1990 (not very much during the darkest winter months but even more so in the summer). There are approximately 8 people who need to use the program, ranging from people who are inexperienced with both computers and observing, to experienced astrophysicists and computer users.

For the programmer, the most useful Ada features were the packaging, tasking and exception mechanisms. The tasking system is mainly useful in the "non-intelligent" part of mapping and tracking, where lots of things need to be done quickly and simultaneously. Exceptions were extremely useful for designing ways to recover from problematic situations and unexpected user response. Packages were useful both for keeping things neatly in order and reusing some previously designed low-level routines (mostly hardware-related routines).

Quasar observations

The task of this program is to measure the total or "continuum" intensity of radio radiation emitted (within the bandwidth of the receiver) by a compact celestial radio source, such as a quasar. The "control" part of the program controls the position of the telescope (the antenna). The "acquisition" part measures the intensity of radio radiation received by the antenna.

For continuum observations of quasars, no AI-methods were needed, since the problem space is well defined and the solutions for increasing the degree of automation of these observations actually only consisted of straightforward implementations of some new functions. We concentrated on reducing user interaction to the point where input is required mainly in the very beginning of the observing session, and after that observations may run automatically or semiautomatically.

For the programmer, the quasar observing program was not as challenging as the solar observing program, because less "intelligence" was needed and also because the timing requirements are not as tight as for the Solar observations. (In the quasar observations the antenna tracking system needs to be very accurate, but for example the data sampling rates are much lower (1 Hz) compared to the 20 Hz or more used in the Solar observations. This doesn't require as much optimizing as in the more time-sensitive observations).

The semiautomatic quasar-observing Ada program is mainly based on the programs which have earlier been used at Metsahovi for the same purpose. All the low-level routines were taken from the earlier programs which were initially run on an HP 2100A and then written in Ada to run on the MicroVAX. Some of these packages are shared with the Solar observing program. Only some new high-level routines were written to improve the user interface and to enable more automatic observations. This was possible mainly because it was very easy to start using the packages that were written earlier, and just add some new features to the high-level routines.

Insights on Transitioning to Ada

In response to my question to Mr. Holsti regarding the challenges which were faced in using Ada, he answered, "Regrettably, I do not think I can supply much interesting information about the challenges we faced in moving the radio telescope control system to Ada--mainly because, as I recall, there were almost none! Ada is much more powerful than the prior language (Algol) and the Ada tasking system is quite equal to this application."

According to Holsti, the switch to Ada took place several years ago, and the problems encountered were due mainly to the simultaneous change of the computer hardware. The old control computer was a diskless, 16-bit, 64 Kb core HP2100A with paper and magnetic tape storage. The old system was significantly different from the new system, which is a MicroVAX running VMS.

Most of the low-level I/O had to be totally rewritten, but this had little to do with Ada and everything to do with the I/O structure of VAX/VMS. In some cases, the developers tried to do memory-mapped I/O directly from Ada, using representation clauses, but often had to go to assembly language because the compiler used wide bus accesses and field masking even for 16-bit data, where the memory mapped devices required 16-bit bus access. Still, the Ada system has less assembly code than the earlier Algol system.

The text of the earlier Algol programs was available. Nevertheless most of the Ada source was typed from scratch. Initial design and development were done on a large VAX machine at the University Computer Center with simulation versions of the packages for process I/O. Final development on the system's own MicroVAX also depended quite a lot on simulation of the hardware, since the telescope was used continuously with the old control system.

The first program to be moved from Algol to Ada was the continuum or "quasar" observation program. No tool beyond a text editor and the VAX Ada compiler was used. The program was constructed by three people: one person for the design; another person for the coding; and a third who collaborated with the other two as a "chief programmer." The designer had an M.Sc. in computer science, but no Ada training. The coder had an M.Sc. in biology, some first-and second-year CS courses, and some years of experience as a business BASIC programmer. The "chief programmer" knew Ada only from having acted as a teaching assistant in a course on Principles of Programming Languages, where Ada was featured in many examples. Later work has drawn on students from an Ada course taught at the Helsinki University of Technology. No other special training has been given and no CASE tools are used.

The original Ada program was small, only about 5,000 to 10,000 lines of source code, but has grown over the years. The Algol program which was replaced was already structured as a set of concurrent tasks (using a homebrew multi-tasking kernel) and very much the same task structure was adopted for the Ada version. This may have reduced the need for a real-time CASE tool.

Points of Contact

Niklas Holsti  
Department of Computer Science P.O. Box 26
(Teollisuuskatu 23) SF-00014 
Telephone:  +358 0 708 4233 
FAX:  +358 0 708 4441 

Merja Tornikoski ( Ari Mujunen ( Seppo Urpo (

Prof. Urpo is the director of the observatory at the following address: Metsahovi Radio Research Station Metsahovintie 114 SF-02540 KYLMALA, Finland Telephone: +358 0 264 429 FAX: +358 0 264 531


Produced in cooperation with Ada Information Clearinghouse, Ada Software Alliance, and ACM SIGAda. Hard copy available from the Ada Information Clearinghouse, at the address below.


The views, opinions, and findings contained in this report are those of the author(s) and should not be construed as an official Agency position, policy, or decision, unless so designated by other official documentation.

Ada Information Clearinghouse (AdaIC)
P.O. Box 46593
Washington, DC  20050-6593
1-800-AdaIC-11 (232-4211), 703/685-1477, FAX 703/685-7019; CompuServe 70312,3303

The AdaIC is sponsored by the Ada Joint Program Office and operated by IIT Research Institute.