ATControl Software for Leica AT 40 x Laser Trackers

The paper describes a software called ATControl which is based on the Matworks Matlab high-level programming language. This software is under constant development by the author in order to collect geospatial data by measuring with the absolute laser tracker Leica AT40x (AT401, AT402). Commercially available software solutions are shortly reviewed and the reasons for developing the new controlling application are discussed. Advantages of ATControl concerning metrological traceability of measured distances are stated. Key functional features of software are introduced.


Introduction
This article describes a user-programmed controlling application for Leica AT40x absolute laser trackers.As long as the original AT401 and the updated AT402 versions share the same system software (firmware), ATControl [3] is compatible with both devices.Since publishing an article about system software errors of Leica AT40x instruments [5], where ATControl was mentioned as a software used for testing, several inquiries from readers about the application have occurred.Therefore, this paper should answer some of these questions and introduce software to others as well.It do not substitutes an operational manual.The idea is to briefly evaluate available controlling applications with respect to geodesy, to provide an overview of the problematic of programming and to point out specific features of ATControl.

Commercially available software
It can be stated at the beginning that there is a lack of software for AT40x which is suitable for classical geodesy.In fact, the author does not know a single one which the main purpose is geodesy in general rather than industrial metrology.On the other hand, it is necessary to admit that the primary purpose of laser trackers is industrial metrology rather then geodesy.But surveyors and metrologists also want to benefit from such state-of-the-art equipment.
Software, supplied for free with the AT40x, is called Leica Tracker Pilot.It is capable of measuring and displaying fundamental geodetic quantities.Version 1.x did not allow data saving at all, version 2.x allows it but only manually and with a potential data-lost risk.Therefore, it is believed that Tracker Pilot is not fully determined to be used for serious measurement tasks, but rather for demonstrational purposes only.The main aim of software F. Dvořáček: ATControl Software for Leica AT40x Laser Trackers is to mediate firmware updating, reflector and compensation file administration and field and compensation test procedures.
Applications for industrial metrology are mainly extensive solutions designed for use in heavy industry, e.g. car and aircraft manufacturing.Components and final products are checked to see if they are manufactured according to specific requirements.Even if the same quantities as lengths and angles are indispensable to be measured, the difference between classical geodesy and the industry-specific use of the instrument is significant.The deal is that advanced functions and lack of fundamental operations in commercial software prevents it from being used for general-purpose measurement in geodesy.
The most important basic operation on the author's mind is a saving of raw measured data such as horizontal and vertical angles and distances.Licensed PolyWorks v.12 obtained with AT401 and a downloaded demo version of SpatialAnalyzer [11] were not capable of such an action at the beginning of ATControl development.Furthermore, it was not possible to save important data (e.g.internal standard deviations, environment conditions).Maybe some additional extensions would allow it but it has never been tried yet.The main reason has been finance resources.It seems not to be very efficient to buy a many thousand-Euro software, not to utilize its advanced functions, but still be forced to buy an extension for enabling very simple features.Software developed for industrial metrology usually exploit the instrument only as a machine for a coordinate measurement and controlling of the instrument is different from what surveyors are looking for.E.g. performing multiple repetitions and two face measurements are not always common actions during industrial measurement where a speed is important when hundreds of points have to be checked.
For purposes of calibrating the Czech state long distances measuring standard Koštice, an application called GeoTracker [6] was developed by Ing.Pavel Hánek, Ph.D. in Research Institute of Geodesy, Topography and Cartography.It is written in Microsoft Visual C#, graphical user interface (GUI) is in Czech language and it is not available for download in a full or a demonstrational version.Software is rather simple but enables measuring and saving features discussed in the paragraph above.Recently, the Finnish A.M.R. company developed DCP Pocket application which is able to control AT40x trackers.The application has not been tested because only 3D coordinate measurement is mentioned in DCP Pocket 1.1 brochure.

Design of ATControl
ATControl is a Matworks Matlab application with a GUI in English language.The application consists of over 30 .m files and over 4000 lines of the source code in the main .mfile.An up to date 32-bit or 64-bit Matworks Matlab or Matlab Runtime environment is required to run the compiled executable file.Leica s Programmer s Manual [7] is used while creating the application and provided libraries (ATL COM -Active Template Library, Component Object Model) are used for establishing connection and placing commands to the instrument.The application has a synchronous interface with a few command which are asynchronous by its nature (e.g.querying reflectors and compensations, obtaining transformation points, error reporting).Synchronous interface means that commands are performed by the emScon server in the same order as they were received.
The correct license file has to be present in installation folder to enable full functionality Geoinformatics FCE CTU 14(2), 2015 F. Dvořáček: ATControl Software for Leica AT40x Laser Trackers of ATControl.The secondary method how to unlock all features is to enter a correct PIN code.Without the license or the PIN code, saving of measured data is restricted and device s initialization forbidden.Sensor can be initialized in any other software (e.g.Tracker Pilot) and then ATControl is useable.The licensing policy is currently not set because of a potential financial profit but in order to monitor current software users and get in touch with them.As the base of users is expected to be very small, contacts with them are valuable with regard to the future testing and application s enhancements.Even if users often require to obtain application s source codes, it has to be stated that scripts are not provided or published by the author in order to eliminate unwanted errors and modifications introduced by users.
Of course, the installation routine of ATControl is avoidable, but it is very convenient for a standard user.The installation cabinet is prepared under the Advanced Installer software and it is able to automatically perform several important tasks.1.To download and installs Matlab Environment if it is not already available.
2. To write ATControl entries to the operating system s registry.

3.
To copy all needed files in Program Files/ATControl folder.4. To copy setting files in User/AppData/Local/ATControl. 5. To register ATControl.dlland LTVideo2.ocx(possibly others) libraries in the operating system.
6. To create a start menu entry and a desktop shortcut.

To prevents of multiple installations of ATControl.
The GUI is designed to be simple but in order to provide an access to all functions as quickly as possible.It is expected to satisfy needs of common surveying and laboratory testing.The graphical design is subject to changes as new functions are added to software.The upper menu bar, the icon bar and the main program window can be used to run desired function and control the laser tracker.There is also a large Data Window designated to display some measurement data (No., Station, Target, Val1, Val2, Val3, StdVal3, HD, VD, t, Face).Info Box shows information, warnings and errors if an expected/unexpected event occurs.

Programming
For programming, low-level C language can be used along with more common C++ and C# languages.Furthermore, high-level COM (Component Object Model) interface called Tracker Programming Interface (TPI) is convenient for creating applications using Visual Basic, VBA (Visual Basic for Applications), Matlab and also C++ and C# under Microsoft Windows.
AT40x Software Development Kit (SDK) is available for downloading on Leica s websites after a free registration.The package of about 100 Mb contains an extensive set of files but only a few of them are actually needed for a chosen programming language.The most The Matlab's high-level programming language is not suitable for developing a professional commercial software, however it is a very powerful and widespread multipurpose tool in research.Many pre-programmed scripts, which are build-in Matlab, allows the programmer to concentrate on software functions rather than on the time-consuming programming routine.The possibility to choose the Matlab system as the programming language has not been available since the very beginning of AT401 s production but it has been added later by the manufacturer.
A short example script for Matlab, attached to the SDK package, was used to get an idea about how communication between Matlab and emScon server works.Furthermore, new commands and their meanings can been found out in the Programmer s Manual [7].In over 500 pages, several errors could be found, but it is understandable considering the amount of content.Unfortunately, no straightforward email contact to report errors or ask questions has been found.In case of a problem caused by an error in the manual, a list of all methods of Geoinformatics FCE CTU 14(2), 2015 LTControl.dlllibrary can be called in order to see at least a number of variables for a specific command.Going through instrument s operational manual [10] helps sometimes too.

AT40x firmware errors
One of things, which differentiates ATControl from other existing commercial and userprogrammed software solutions, is that it enables several firmware errors of Leica AT40x instruments to be eliminated.This advantage was one of the reasons why a few AT40x university users have been interested in software and maybe others will be in the future.For that reason and for the convenience of the readers, the errors will be shortly summarized further in the text, for more details see the author s article System Software Testing of Laser Tracker Leica AT401 [5].

The Refractive model
From Leica, a document describing the computation procedure of the group refractive index of air was obtained on 5th May 2013 [8].According to this paper and also practical testing, AT401 uses equations derived from Edlén s formula by defaulte.It can reach up to a 0.5 ppm difference from the Ciddor & Hill procedure (1996 [1], 1999 [2]) recommended by the resolution of the IAG (International Geodetic Association) in 1999 in Birmingham [12].Even if these default formulas can be overruled by a user-programmed procedure, it is not very probable that many programmers would do so. ATControl

The Wavelength of the ADM
It can be found in the paper from Leica [8] that AT401 operates on 795 nm wavelength.In the instrument's manual 780 nm is declared [10].It shows that AT401 physically operates with 795 nm wavelength laser beam but the instruments perform the computations with the wrong wavelength of 780 nm.Therefore, a systematic distance-independent error of about 0.3 ppm in the refractive index of air is present.
ATControl uses 795 nm or the user-inserted value of wavelength in all computations when WMS (Weather Monitor Status) is NotConnected or ReadOnly.When it is in ReadAndCal-culateRefractions mode, there is no possibility to fix the error because all computations are left to be performed by the emScon server.

Improper updates of the group refractive index of air
The issue of improper updates of the refractive indices is a bit more complicated to discover and also to fix.By some unexplained reason AT401 tracker neglects changes in refractive index of air up to 0.5 ppm.Even if new atmospheric parameters are obtained from ATC400 (AT Controller 400) meteostation or if a newly given user-computed refractive index is inserted, emScon server does not update the value in its internal memory.This leads to the fact that the measured length to be very often corrected with an outdated value of the refractive index, sometimes even several hours old.
The trick of fixing this error consists in applying a wrong refractive index which differs from the right one at least by 0.5 ppm.Setting of the right value follows immediately.By doing so, ATControl always ensures that the correct refractive index is stored in the emScon server memory before a new measurement starts.Every distance is corrected by the refractive index of air by using atmospheric parameters (temperature, atmospheric pressure, relative humidity and eventually CO2 content) which are at max. 20 s out of date ( = emScon server refresh rate).This does not apply to the automatic ReadAndCalculateRefractions mode of WMS because the trick with setting the wrong refractive index cannot be used.
By fixing this error and by setting a user s refraction procedure, a slight numeric inconsistency in the reading and saving of atmospheric parameters can occur.The measurement routine is such as: 1) set wrong refractive index, 2) obtain atmospheric parameters, 3) compute refractive index of air 4), set refractive index, 5) start measurement.If a new automatic atmospheric sensor reading took place (every 20 s) in a short period of time between steps 2 and 5, emScon server returns the atmospheric parameters which were not used for calculating the refractive index of air.For that reason, used_t, used_p and used_rh values are also saved to the output .txtfile.

Insufficient resolution of temperature readings
Even if the resolution of reading of air/object temperature would be desirable to 0.01 °C, it is not usually available.It seems that the interface of the ATC400 is designed for returning only 3 valid digits in case of temperature readings.E.g. obtaining 9.99 °C is possible, but 10.01 °C is not (10.0°C only).ATControl mediate reading of temperature at the maximum resolution which is obtainable from emScon server but it cannot fully fix the issue without intervention to the instrument s firmware.
To demonstrate that the discovered errors are significant and should be taken into account by all current and potential users, a summary has been made.The purpose of the tables below (Table 4, Table 5) is to show how the errors may effect measuring with AT40x in ordinary conditions -both in laboratory and outdoor.The impacts of errors depend on ambient atmospheric conditions and its gradients as well as on the length to the target point.Both extremes (Min, Max) of these error intervals are evaluated in the tables.The max. error is derived as the maximum possible influence for the whole instrument s working range (<0; 160> m distance, <0; 40> °C temperature, <500; 1100> hPa atmospheric pressure, <0; 95> % relative humidity).In laboratory conditions, stability of temperature ±0.25 °C at 20 °C and 30 m length is assumed.A reduced range of temperature <0; 30> °C is used for the outdoor evaluation.Notice that an error in the group refractive index of air causes an error of about the same amount in the measured distance (km).Each of the described issues itself potentially exceeds the manufacturer s specification about the accuracy of the distance measurement (5 µm) [9, 4].

Key functions of ATControl
In this section of the paper, key functions of ATControl are introduced.
Geoinformatics FCE CTU 14(2), 2015 F. Dvořáček: ATControl Software for Leica AT40x Laser Trackers LAN, Wi-Fi and user-defined TCP/IP address connection is possible.All WMS modes (Not-Connected = Off, ReadOnly, ReadAndCalculateRefractions = Calculate) and all measurement modes (Standard, Precise, Fast, Outdoor) are integrated.All Leica s defined coordinate systems (4x rectangular, 2x cylindrical, 2x spherical) are incorporated.Along with original unit system (m, °C), the secondary imperial unit system (yd, F) has been recently added.
ATControl always raises the GUI with settings from the last properly closed instance of the application.Predefined settings for the baseline measurement, a possibility to restore default settings and to save and load user s settings is programmed.Reflector and compensation file lists can be loaded and the chosen settings saved.
The Overview Camera (OVC) can be connected and a live video stream transmitted to a PC in real time.The frame rate per second and the image parameters (contrast, brightness, saturation) can be set.By clicking into a point in the image, followed by the Move button, the sensor automatically rotates to aim to the specified point.
Laboratory laser-interferometer Renishaw ML10 and step motor Microcon M1486 can be controlled in order to allow simultaneous measurement by the tracker and the interferometer.The precise step movement of the interferometer carriage can be set.The lengths measured by the interferometer are stored into PCode column.
Robot Mode in the Manual setting is able to "remember" positions of last observed points.By switching to Automatic a sequence of previously measured points can be launched with required repetitions, face mode and breaks among both individual measurements and measurement sets.This enables an automatic monitoring measurement without a user s intervention.
The sensor can be moved by clicking into the OVC image or by using multiple buttons and sliders.The last measured point can be aimed or the sensor can be orientated according to a given horizontal and vertical angle.A reflector can be located by using the Find reflector function with the appropriately chosen parameters (radius, time-out, distance).
Stable Probing allows a repeated stationary point measurement without a PC operator interaction.When a reflector is placed still within a specified angle tolerance and a time period, the new measurement initiates automatically.
The Interferometer Refraction function enables to compute the phase refractive index of air which can be manually inserted into a controlling software of a laboratory interferometer.This ensures that both the tracker and the laser interferometer use the same principle of the atmospheric correction of measured distances.
Almemo Data Join provides the possibility to combine externally collected atmospheric data with AT40x data.In this case specifically, the Ahlborn Almemo data-logger (e.g.2590-4S) exported data in .xlsformat can be added to a .txtdata file from ATControl.The most important step is to link tracker s data with time relevant atmospheric data of the external data-logger.The maximum acceptable time difference for combining the parameters has to be stated.At the end, corrected distances reflecting all appropriate atmospheric data are computed and stored.
If required, measured data and error reports are save to the .txtfile.Data are grouped into columns for easy further processing in any spreadsheet editor.All possible data obtained from the ATC400 under extended statistical format are stored (Hz, V, SD, Std_Hz, Std_V, F. Dvořáček: ATControl Software for Leica AT40x Laser Trackers For surveying, several handy measurement settings are included, e.g.measurement repetitions, relative and absolute pause between measurements.The relative pause is an interval between the end of the last measurement and the start of the next one, the absolute pause is the interval between two subsequent starts of measurement.To save sensor s batteries and time of measurement during the two face mode (1, 2, 1, 2), also the 50:50 (1, 1, 2, 2) and the irregular change (1, 2, 2, 1) of faces can be set.If a measurement failed and the Add checkbox is ticked on, ATControl adds new measurements as long as a specified number of successful repetition is completed.The measurement progress bar along with estimated time remaining to the end is displayed during the measurement process.Measurement sequence can be terminated after each single measurement by clicking the Cancel button.
When measuring in a rectangular CS (Coordinate System), the default CS with [0, 0, 0] station coordinates and a random orientation is set by the laser tracker.In many surveying F. Dvořáček: ATControl Software for Leica AT40x Laser Trackers tasks, a specific measuring CS is required.To be able to perform instant work in that system, a transformation is necessary.This functionality is built inside ATControl.Nominal transformation point coordinates and standard deviations are loaded from a file and actual transformation points are instantly measured.The scale can be fixed to 1 or left unknown during transformation.Both nominal and actual points can be weighted during computation.A protocol of the transformation s result is created and can be stored as a separate file.
Marking out points is made easier by loading a file with point coordinates.If the Mark Out checkbox is ticked on and a measured target point number match the point number in the loaded file, coordinate differences are displayed when a measurement is finished.
Multiple graphs of different observed quantities and computed values can be created according to the user s choice.Graph data are then regularly updated after each successful measurement.Absolute values or differences from the first measurement can be displayed.It is useful for monitoring purposes, e.g.distance differences and temperature changes can be observed and a suspicious measurement result is instantly detected.Software for industrial metrology has advanced graphical CAD style interface.This is not the goal for ATControl but a graphical sketch of measured points could be needed if many points are measured on an object.For that reason, a 3D sketch of points is build-in.XYZ coordinates are directly obtained from the measurement result or they are calculated if not a rectangular measurement system is being used.It is possible to automatically draw a line between observed points.Additional manual drawing into the graph is possible.The graph is interactive and therefore the point cloud can be viewed from any desirable position, including a quick 2D view of XY, XZ and YZ planes.

Conclusion
ATControl is a user-programmed application designed to control measuring with Leica AT40x trackers.The main purpose of use of software is surveying in general, length metrology and the laboratory testing.Some specific features have been developed mostly for author s needs, e.g. a possibility of combining external meteorological data from Ahlborn Almemo data-loggers or controlling a laboratory laser interferometer Renishaw ML10.It is possible to incorporate any similar add-on in order to create a highly automated measurement system.By correcting several system software errors, ATControl ensures more control over metrological traceability of distance measurements.11 well-known procedures for computing refractive index of air are included.Automated savings of all values returned by the tracker along with other computed values and description data is granted.