ATControl Software for Leica AT40x Laser Trackers Filip Dvořáček Czech Technical University in Prague Department of Special Geodesy Czech Republic filip.dvoracek@fsv.cvut.cz Abstract The paper describes a software called ATControl which is based on the Matworks Matlab high-level programming language. This software is under constant develop- ment by the author in order to collect geospatial data by measuring with the abso- lute 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 trace- ability of measured distances are stated. Key functional features of software are introduced. Keywords: ATControl, controlling software, Leica Geosystems, laser tracker, Leica AT401, Leica AT402, Mathworks Matlab, emScon server, length metrology 1. 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 Geoinformatics FCE CTU 14(2), 2015, doi:10.14311/gi.14.2.2 9 http://orcid.org/0000-0003-4336-056X http://dx.doi.org/10.14311/gi.14.2.2 http://creativecommons.org/licenses/by/4.0/ 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. 2. 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 .m file. 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 10 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.dll and LTVideo2.ocx (possibly others) libraries in the operating system. 6. To create a start menu entry and a desktop shortcut. 7. 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. The first usable version (v. 0.9) of ATControl has been issued on 2013-05-03. Since then, 17 updated versions have been produced. Errors in Leica´s firmware concerning the air refraction has been eliminated since 2013-06-21 (v. 1.5). Version 3.3 is currently the latest stable version of ATControl issued on 2015-08-13. 3. 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 Geoinformatics FCE CTU 14(2), 2015 11 F. Dvořáček: ATControl Software for Leica AT40x Laser Trackers Figure 1: The GUI of ATControl 1.9 valuable file is a DLL library called LTControl.dll which contains a database of all of the common commands used for controlling AT40x instrument through the COM interface. It has to be registered in Windows with regsvr32 command. 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 12 F. Dvořáček: ATControl Software for Leica AT40x Laser Trackers Figure 2: The GUI of ATControl 3.3 LTControl.dll library 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. 4. AT40x firmware errors One of things, which differentiates ATControl from other existing commercial and user- programmed 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 uni- versity 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]. 4.1. 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 enables the employment of 11 different procedures for calculating the refractive index: Barrell & Sears (1939), IUGG (1963), Edlén (1966), Owens (1967), Peck & Reeder Geoinformatics FCE CTU 14(2), 2015 13 F. Dvořáček: ATControl Software for Leica AT40x Laser Trackers (1972), Birch & Downs (1994), Ciddor (1996), Ciddor & Hill (1999), IAG (1999), Ciddor (2002), Leica AT40x (2013). All equations are derived from primary data sources – authors´ original papers [4]. A CO2 content in air can be inserted (default 400 ppm) and it is taken into account in all possible formulas. 4.2. 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. 4.3. 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 .txt file. Geoinformatics FCE CTU 14(2), 2015 14 F. Dvořáček: ATControl Software for Leica AT40x Laser Trackers Table 1: Impacts of AT40x firmware errors [ppm] Error Max. error Estimated common error Laboratory Outdoor Min Max Min Max Min Max Refractive model 0.01 0.64 0.07 0.12 0.01 0.32 Wavelength -0.31 -0.27 -0.28 -0.28 -0.28 -0.27 Updating n -0.50 0.50 -0.25 0.25 -0.50 0.50 All together -0.80 0.87 -0.46 0.09 -0.77 0.55 Table 2: Impacts of AT40x firmware errors [µm] Error Max. error 160 m Estimated common error Laboratory 30 m Outdoor 160 m Min Max Min Max Min Max Refractive model 2 102 2 4 2 51 Wavelength -50 - 43 -8 -8 -45 -43 Updating n -80 80 -8 -8 -80 80 All together -128 139 -14 3 -123 88 4.4. 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]. 5. Key functions of ATControl In this section of the paper, key functions of ATControl are introduced. Geoinformatics FCE CTU 14(2), 2015 15 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 measure- ment 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 measure- ment 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 inter- action. 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 .xls format can be added to a .txt data 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 .txt file. 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, Geoinformatics FCE CTU 14(2), 2015 16 F. Dvořáček: ATControl Software for Leica AT40x Laser Trackers Figure 3: Measurement graphs - differences (rotation of a centring device Leica GZR3) Std_SD, Std_Total, Covar_12, Covar_13, Covar_23, PointingError_1, PointingError_2, PointingError_3, AprStd_Hz, AprStd_V, AprStd_SD, AprStd_Total, AprCovar_12, AprCo- var_13, AprCovar_23, t, p, RH, TryMode). Furthermore, more information is included (Time, #No., Station, Target, StationHeight, TargetHeight, Used_t, Used_p, Used_RH, Used_CO2, RefIndex, HD, VD, Face, RefProcedure, WeatherMonStatus, MeasMode, Reflec- tor, Compensation, CoordinateSystem, PCode). For surveying, several handy measurement settings are included, e.g. measurement repeti- tions, 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 Geoinformatics FCE CTU 14(2), 2015 17 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 measure- ment. 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. Figure 4: 3D graphical sketch (rotation of a centring device Leica GZR3) 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. Geoinformatics FCE CTU 14(2), 2015 18 F. Dvořáček: ATControl Software for Leica AT40x Laser Trackers 6. 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. References [1] P. E. Ciddor. “Refractive index of air. New equations for the visible and near infrared”. In: Applied Optics 35 (1996), pp. 1566–1572. [2] P. E. Ciddor and R. J. Hill. “Refractive index of air. 2. Group index”. In: Applied Optics 38 (1999), pp. 1663–1667. [3] Filip Dvořáček. ATControl. Online. Application to control measuring with Leica AT40x trackers. url: http://k154.fsv.cvut.cz/~dvoracek/software.html. [4] Filip Dvořáček. “Nepřímé určení indexu lomu vzduchu pro výpočet fyzikální redukce elektronických dálkoměrů”. In: Geodetický a kartografický obzor 59(101).10 (2013), pp. 253– 266. url: http://archivnimapy.cuzk.cz/zemvest/cisla/Rok201310.pdf. [5] Filip Dvořáček. “System Software Testing of Laser Tracker Leica AT401”. In: Geoinfor- matics FCE CTU 13 (Dec. 2014), pp. 49–57. doi: 10.14311/gi.13.6. [6] Pavel Hánek. GeoTracker. 2011. url: http : / / www . vugtk . cz / odd25 / kostice / geotracker.html. [7] Leica Geosystems. EmScon 3.8. Leica Geosystems Laser Tracker Programming Interface - Programmers Manual. Online. Switzerland, 2013. [8] Leica Geosystems. Formula for Calculating the Refractive Index of Ambient Air used for the Leica AT401 of Hexagon Metrology. 2013. [9] Leica Geosystems. Leica Absolute Tracker AT401. Online. Switzerland, 2010. [10] Leica Geosystems. Leica AT401 User Manual v. 2.0. 2013. [11] New River Kinematics. Download. 2014. url: http://www.kinematics.com/download/ index.php. [12] J. M. Rueger. Refractive Indices of Light, Infrared and Radio Waves in the Atmosphere. University of New South Wales, 2001. isbn: 9780733418655. Geoinformatics FCE CTU 14(2), 2015 19 http://k154.fsv.cvut.cz/~dvoracek/software.html http://archivnimapy.cuzk.cz/zemvest/cisla/Rok201310.pdf http://dx.doi.org/10.14311/gi.13.6 http://www.vugtk.cz/odd25/kostice/geotracker.html http://www.vugtk.cz/odd25/kostice/geotracker.html http://metrology.leica-geosystems.com/common/shared/downloads/inc/downloader.asp?id_0=20453&submit_0=Download&id_1=19781 http://metrology.leica-geosystems.com/downloads123/m1/metrology/AT401/brochures-datasheet/Leica%20Absolute%20Tracker%20AT401%20Factsheet_en.pdf http://www.kinematics.com/download/index.php http://www.kinematics.com/download/index.php Geoinformatics FCE CTU 14(2), 2015 20