NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Software > PlanOfRecordC32006 > ModificationRequest8C306
   Changes | Index | Contents | Search | Statistics | Go

Antenna Manager Rehosting on Linux

Modification Request #8 (C3 2006)



1. Introduction

Currently the GBT antenna control system uses a jerk-limiting algorithm described in GBT Memo 203 to slew between scans. Recently Fred Schwab has described an improved algorithm which attempts to further minimize the slew trajectory. The newer algorithm is expected to require significant computing resources, exceeding the capabilities of the current system. This MR describes the effort to rehost the GBT antenna controller/antenna manager onto a more capable platform.

2. Background

Currently the antenna controller (a.k.a the antenna manager) is hosted on a 167MHz sparc Ultra-1 system running Solaris. It is estimated the improved algorithm will be more computationally intensive. Therefore a key prerequisite is to rehost the antenna manager on a more capable linux-based platform.

3. Design

3.1 Code Refactorings

3.2 System Hardware

The antenna manager is targeted for deployment on a Intel Pentium-4 type system running Redhat linux. In order to maintain command timing, the program will run in the SCHED_FIFO scheduler class with real-time priority. The interface into the servo system is via 10base2 coaxial type 10Mbit Ethernet. I have two 3Comm PCI 3C900B cards in hand for this purpose.

3.3 System Time Sychronization

The antenna manager is required to be synchronized with the servo system clocks in order to perform correctly. The current Solaris based system uses an 1-pulse-per-second input into the serial port, in conjunction with the ntp 1pps clock driver. On linux, a similar technique can be used via the shm-rtc.c utility. The Computing division will begin monitoring the time sychronization parameters on the new antenna host.

A 5 day run of monitoring the new system (algol) time offsets in milliseconds is shown below:

The red line above indicates the system time as measured against the 1PPS signal. The green and blue traces are system time offset with respect to the time servers sadira and arcturus. The point here is to show that the system time is stable to the sub-millisecond mark. The approximately two millisecond excursions can be addressed by changing some of the shm clock parameters.

3.4 Real-time issues

The antenna manager is a real-time system. Commands generated by the antenna manager must be 'launched' at the appropriate time, so that the GBT CCU and SCU servo systems receive the command in time to act upon it. The command window is on the order of 20 milliseconds. As a side note, this window in not symmetrical, that is, the effect of commands exceeding the window in one direction are not the same as exceeding the window limit in the other direction. This is due to a problem in the servo code which has not been addressed. Fortunately, the conditions under which the timing is violated in one direction are very infrequent. This problem is detailed here.

The existing Solaris system is able to meet the command window deadline[1] by setting the task scheduling interval to 1000Hz, and placing the process at very high priority. Attempts to do this on Linux 2.4 kernels were less than impressive, largely due to a slower scheduling interval. The recent Redhat Enterprise 4 OS now has the newer 2.6 version kernel, with 1000Hz scheduling. Initial tests show that nearly identical timing performance can be achieved using the fast-scheduler and high priority approach.

In order to access the elevated scheduling priority, the antenna manager process must be "setuid root". To make this easier to configure, the Linux version will have the Starlink library statically linked.

[1] - I should note that there are exceptions to this statement. Perhaps the phase "no unexpected dropouts" is more precise. Since this is a soft-real-time system, deadlines are met most of the time.

3.5 FITS File Modifications

As requested by the CCC, a minor modification will be made to the antenna FITS file format. A new primary header keyword "WEATHSTA" will be added to indicate the source of weather information. The values will be one of "Weather_Station_1", "Weather_Station_2", or "User_Input". In order to denote this change, the FITSVER keyword value will be changed to 2.10.

4. Deployment Checklist

What has to get done to integrate this completely into the system. This checklist must be completed before Cycle Integration Testing begins.

5. Test Plan

The following tests shall be conducted to verify proper operation:

Verification Matrix
Test Criteria Result
Packet command timing periodic to a few msec DONE
Az/El command stream values identical in RA/DEC track DONE
RA/DEC indicated values identical in AZ/EL track DONE
Pointing/Focusing scan results identical DONE

Testing Results

There are two major numerical processing pipelines in the antenna: one transforms sky positions to servo commands, the other takes indicated servo position and transforms them back into sky coordinates. These tests were run multiple times, but the data shown below are from two scans. The first is a 25,000 second long RA/DEC track, which started around 123,65 (az/el) transited at an elevation of 74.5 degrees, and ended at 284,19.5 probing a range of elevations.

Testing Sky to Ground Command Generation

Using two antenna simulators, one running linux the other a sparc-solaris system. Scans were run with a common specified start time, tracking an RA/DEC position. By comparing the observed commanded AZ/EL positions (i.e the OBSC_AZ, OBSC_EL columns) performance of the sky to ground transformations can be compared with the existing system. Results of this run is shown below.

Below are plots of the delta between a sparc-based simulator and the Linux-based simulator, during a simultaneous observation:

OBSC_AZ Commanded Position Delta During J2000 RA/DEC Track
File: 2006_05_15_23:19:00.fits

OBSC_EL Commanded Position Delta During J2000 RA/DEC Track
File: 2006_05_15_23:19:00.fits

It should be noted that these graphs are a bit misleading! Direct inspection of these files with fv shows that the two columns are exactly the same. In either case, the test shows that even during an extended scan (25,000 seconds in length) commands generated are for our purposes, the same.

Testing Indicated to Sky Computations

A second test running two simulators tracking a constant AZ/EL position was used to verify the indicated to sky position conversion pipeline. In this test, the resulting RA/DEC positions of a constant AZ/EL position were compared. Difference plots are shown below.

Note the next two plots were taken with the two systems tracking a constant az/el position.

RAJ2000 Indicated Position Delta During AZ/EL TRACK
File: 2006_05_16_14:03:00.fits

DECJ2000 Indicated Position Position Delta During AZ/EL TRACK
File: 2006_05_16_14:03:00.fits

Testing Refraction Calculation

The plot below shows the difference in refraction during an extended RA/DEC scan. The plot of the difference between the mount elevation (MNT_EL) is shown for informational purposes only, and is not necessarily expected to be identical.

Refraction Delta During RA/DEC TRACK
File: 2006_05_15_23:19:00.fits

This plot appears a bit "noisy" because the refraction column data is based upon the indicated elevation (i.e. MNT_EL). Note the plot below shows the refraction noise correlates well with the indicated elevation "noise". The elevation rate went to zero as at the transit around the 50,000th sample. The elevation rate was highest near the end of the scan.

Indicated Elevation Delta During RA/DEC TRACK
File: 2006_05_15_23:19:00.fits

Testing nHz Loops

This is confirmed implictly, for if these were not correct, the data would not be complete.

Testing Focus Axes

The following are plots of the difference in indicated position in mm and tilt difference in degrees of the two simulators during an RA/DEC track. To put the plots in perspective, 1 encoder bit corresponds to 0.012mm.

Subreflector X Position Delta During RA/DEC TRACK
File: 2006_05_15_23:19:00.fits

Subreflector Y Position Delta During RA/DEC TRACK
File: 2006_05_15_23:19:00.fits

Subreflector Z Position Delta During RA/DEC TRACK
File: 2006_05_15_23:19:00.fits

Subreflector X Tilt Delta During RA/DEC TRACK
File: 2006_05_15_23:19:00.fits

Subreflector Z Tilt Delta During RA/DEC TRACK
File: 2006_05_15_23:19:00.fits

I also ran a focus scan, and logged data with the subreflector command samplers. The commands in servo coordinates are exactly identical.

FITS Header Comparisons

I've examined the antenna FITS headers under several circumstances, and they are exactly the same, with one notable exception: the LSTSTART keyword differs in the last two digits (i.e 1.213649922842640E+03 vs. 1.213649922842655E+03) or 15 femto-seconds. I've tracked this down to the SLALIB routine which computes the equation of the equinoxes. The equation of the equinoxes calculation (i.e. slaeqeqx()) returns a result which is very slightly different on Sparc vs. Linux. I must assume this is due to the architecture differences.


Other Testing

A number of live tests were conducted during integration tests, including several diasy-pedal scans, and pointings. Dana's log file and results are included below:
Proj: TINT_01

Use L-band to test AutoPeak's for Linux and Sparc versions

Scan      Source     Proc      Version Comments
--------  ---------  -------   ------- ---------------------------------------
29-32     2129+8453  Peak      Linux   LPCs (0.150, 0.029)
33-36         "       "          "     LPCs (0.313, -0.088)
37-40         "       "          "     LPCs (0.326, -0.038)

41-44         "       "        Sparc   LPCs (0.265, -0.040)
45-48         "       "          "     LPCs (0.192, -0.062)
49-52         "       "          "     LPCs (0.187, xxxxxx)

No corrections detected on last El scans but otherwise okay.

Check daisy petal scans for Linux and Sparc versions

53            "      Daisy     Sparc   LPCs not zero
54            "       "        Linux   LPCs are all zero
55            "       "          "
56            "       "        Sparc

In addition, I have examined and compared computational differences in unit-tests at different levels of the system. Initially a systemmatic error was noted at a very small level. This was traced to a bug in the system, which has to do with how the equation of the equinoxes was computed on system startup. Typically this is calculated once a day, at UTC midnight. However on system startup the value was calculated based on the current time. I've changed this to always use UTC midnight.

Signatures

APPROVED: I acknowledge that my request is fully contained in this MR, and if the SDD delivers exactly what I specified, I will be happy.

ACCEPTED: I acknowledge that I have validated the completed code according to the acceptance tests, and I am happy with the results.

Written DONE - JoeBrandt - 14 Apr 2006
Checked DONE - MelindaMello - 27 Apr 2006
Approved by Sponsor DONE - JohnFord - 26 Apr 2006
Approved by CCC DONE - RichardPrestage - 17 May 2006
Accepted/Delivered by Sponsor DONE - DanaBalser - 17 May 2006

Symbols:


CCC Discussion Area

As well as confirming that the correct demands are sent to the antenna servo at the correct time, I think it is extremely important that we check that the correct "upstream" co-ordinate conversions are performed, since this determines where the observers "think" the antenna was pointed. Also, since mechanisms to generate the nHz loops have changed, we need to check very carefully that the synchronization / indexing is all still correct. If I understood correctly from conversations with Dana it is possible to "reset" the antenna simulator (and hopefully manager) clocks so that it is possible to run the "same" scan multiple times. I'd therefore like to suggest that the following tests be performed.

I'm sorry I have only just got around to proposing this, and I realise it is a very large amount of work. But the antenna underpins everything, so I think it is important.

Richard,

The comments above about "resetting clocks" is not available. The systems all run synchronized with the site IRIG and 1PPS signals, so testing and comparisons must be done simultaneously. This is the approach I've taken in using the two simulators. In most all cases the FITS files are identical, with a couple exceptions. One I've noted, and reproduced outside of the antenna code is the calculation of the equation of the equinoxes, using a SLALIB routine, I get results which differ in the last couple digits. This causes the LSTSTART keyword to differ slightly (~15 femto-seconds).

The question could be asked "To what level should we expect identity?" With 64 bit floating point, you get about 15-16 significant digits. With 32 bit about 8-9 significant digits. Most of the differences (excluding the servo related ones) are on this level. The servo simulator is numerically noisy for a number of reasons. Internally, it is taking az/el, asynchronously closing a servo loop, and generating positions at 10 cycles/sidereal second. This in turn is resampled to 50 samples/solar second. Secondary optics are computed and sent over the network as 32 bit-floats, further complicating matters. So I would not expect two simulators to compute the same axis position, even with identical inputs. That is why I emphasize the comparison of commands.

I hope the added material addresses your concerns noted above.

JoeBrandt

-- JoeBrandt - 06 Apr 2006

Attachment: sort Action: Size: Date: Who: Comment:
t1.png action 9017 27 Apr 2006 - 14:54 JoeBrandt  
OBSC_AZ.png action 3802 16 May 2006 - 13:15 JoeBrandt Residual plot of OBSC_AZ column
OBSC_EL.png action 4828 16 May 2006 - 13:17 JoeBrandt Residual plot of OBSC_EL column
MNT_AZ.png action 6293 03 May 2006 - 21:13 JoeBrandt Residual plot of MNT_AZ column
MNT_EL.png action 16287 16 May 2006 - 16:02 JoeBrandt Difference plot of MNT_EL column
RAJ2000.png action 6223 16 May 2006 - 15:30 JoeBrandt Residual plot of RAJ2000 column
DECJ2000.png action 3509 16 May 2006 - 15:30 JoeBrandt Residual plot of DECJ2000 column
REFRACT.png action 7892 16 May 2006 - 14:49 JoeBrandt Difference plot of refraction during RA/DEC track
SR_XP.png action 9006 16 May 2006 - 14:49 JoeBrandt Subreflector X position difference during RA/DEC
SR_YP.png action 8944 16 May 2006 - 14:50 JoeBrandt Subreflector Y position difference during RA/DEC
SR_ZP.png action 7450 16 May 2006 - 14:50 JoeBrandt Subreflector Z position difference during RA/DEC
SR_XT.png action 10144 16 May 2006 - 14:51 JoeBrandt Subreflector X tilt difference
SR_ZT.png action 11827 16 May 2006 - 14:52 JoeBrandt Subreflector Z tilt difference

Topic ModificationRequest8C306 . { Edit | Attach | Ref-By | Printable | Diffs | r1.19 | > | r1.18 | > | r1.17 | More }
Revision r1.19 - 17 May 2006 - 19:43 GMT - RichardPrestage
Parents: PlanOfRecordC32006
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.