Calibration
Calibration is required to align the pointer device co-ordinate system with the video co-ordinate system. When using an absolute pointer device, such as a touch screen monitor, the point of contact should be activated under the stylus when it is in contact with the pointer device.
This document covers the calibration feature in UPDD 6 and UPDD 7 on Windows, macOS and Linux: when calibration is needed, how to run it, the calibration procedure, the settings that control it and how to save and restore calibration data.
When calibration is needed
For USB HID devices the driver reads the X and Y co-ordinate range from the HID report descriptor held in the touch device and uses this range to calculate default calibration data, which is then stored in the UPDD settings file. In most cases we would expect this default calibration data to give accurate calibration, so in a single monitor setup an HID touch screen will often need no configuration after the driver is installed. Further, if a device has been preconfigured with default calibration data then there is a good chance touch will be accurate after install.
Calibration is required if the stylus is not accurately placed when touched. For legacy USB and serial devices the calibration procedure will need to be performed where calibration is inaccurate.
UPDD uses a calibration algorithm that caters for devices with poor linear characteristics. The algorithm is dependent on the accuracy with which the calibration is done, so it is very important to calibrate with a stylus that can select the exact centre of the calibration cross.
In a multi-monitor setup where touch moves the pointer on the wrong monitor, the touch screen and monitor association needs to be set, as described in Monitors: identify, bind, metrics and segments.
Invoking calibration
The calibration program is called 'UPDD Calibrate'. The calibration procedure can be invoked in a number of ways:
- From the UPDD Console, Calibration function.
- By running the UPDD Calibrate program from within its folder or via a command line, such as in these examples:
OS Command line Windows "C:\Program Files\UPDD\UPDD Calibrate.exe" device=1 - V7
"C:\Program Files (x86)\UPDD\UPDD Calibrate.exe" device=1 - V6macOS /Applications/Utilities/UPDD\ Calibrate.app/Contents/MacOS/UPDD\ Calibrate device=1 Linux ./upddenv ./UPDD\ Calibrate device=1 - From any UPDD client application using the UPDD API, as described in Device control from the API.
Running UPDD Calibrate without any parameters will, in a multi-monitor environment, identify all touch screens to make the touch screen / desktop association. Thereafter it will calibrate all active UPDD devices by showing the calibration screen for each device on its associated monitor.
The calibrate program can take these arguments:
| Argument | Description |
| identify | Identifies active UPDD devices and creates the relevant monitor associations. Only required in multi-monitor environments. See Identify. |
| device=n | Calibrates a specific UPDD active device. The calibration screen is shown on the monitor associated with the device. |
| toolbar=n | Calibrates the specified toolbar. |
A text based 2 point calibration is also available from the command line with upddutils calibrate.
Calibration procedure
If working in a multi-monitor environment, and running the calibrate program without specifying a device, the calibration procedure will attempt to identify each touch screen and will show a single cross in the middle of each discovered monitor. Touch this cross using the pointer device (touch screen or pen) if the monitor has an associated pointer device, or select the 'Next' or Alt/Option+x option to skip this monitor. For a single monitor system all UPDD active devices are associated with Monitor 1.

The calibration screen will be invoked for each identified device, displaying calibration points that should be selected in turn.

The calibration sequence for each cross is:
| Stage | Description |
Initial cross | When the calibration margin is 5% or more a target (cross) is shown for each calibration point. |
Initial touch | As soon as any data is received a light coloured circle is shown around the target. |
Good data sample | When the calibration point is ready to be accepted (enough time has passed while touching) a dark circle is shown around the target. If the touch is not sufficiently long the original cross icon is shown again. |
Important notes:
- UPDD disables pointer movement during calibration so there should be no cursor movement. If the pointer is moving but the calibration touches are ignored, it is likely that a different driver is in control of the device, not UPDD.
- In some cases the calibration screen may not cover the entire screen but the calibration points should be placed in the correct location. If the calibration screen is distorted or the calibration points are not shown in the correct location, try the text based calibration using the command upddutils calibrate.
- The time taken to record a touch sample is 750ms. The sample is taken at the point when the circle turns dark.
- If the defined monitor is not found monitor 1 is assumed.
- To clear calibration data held in the UPDD settings file as extracted from a USB HID device, use the command
upddutils setall hid.report_descriptor.crc "". This forces the driver to reread the data held in the HID report descriptor and recalculate the default calibration data.
Exit codes
UPDD Calibrate returns these exit codes:
| Code | Meaning |
| 0 | Success |
| 2 | Calibration timed out |
| 3 | Escape |
| 4 | Syntax error in command line |
| 5 | Failure to connect to driver |
| 6 | Device not found (invalid device handle) |
| 7 | Device not connected |
| 8 | Another instance already running |
| 9 | EEPROM calibration not supported by the controller |
| 10 | No device associated with the toolbar's monitor (toolbar=n) |
Calibration settings
The following UPDD settings relate to the calibration process. The number of points, margin, timeout and confirm settings can also be changed in the UPDD Console, Calibration function.
| Setting | Scope | Description |
| calibration_cancel | Global | Show a cancel button at the end of calibration at the same time as the confirm button. Default 0 = no cancel button shown, 1 = show cancel button. Only effective if calibration_confirm is on. |
| calibration_confirm | Global or device | Require a confirmation button press at the end of calibration; if it is not touched the previous calibration data is restored. Default 0 = no confirmation, 1 = confirmation. It is on if set either globally or for the device. |
| calibration_confirm_text | Global | Show the text "Please press the button above to confirm calibration" when the confirm calibration button is visible. Default 0 = confirm text not shown, 1 = confirm text shown. |
| calibration_margin | Device | The margin used for the calibration points (expressed as a percentage of the pixel resolution) from the edge of the calibrated area, on which the current calibration is based - maintained by the driver - do not manually update. |
| calibration_margin.next | Device | The calibration margin (expressed as a percentage of the pixel resolution) used for the next calibration. If blank the value of calibration_margin is used. 10% is the default; a range of 1 to 15 is realistic. You will lose part of the calibration cross with small margins (<5%) but as long as you can touch the centre dot all should be OK. This may be difficult on some systems at 0%, being the extreme corner. In this example the margin is set to 1 percent on a 1980 x 1080 desktop using the command upddutils set calibration_margin.next 1, so the first calibration point is drawn at pixel location 18,9 (zero based): |
| calibration_min_delta | Device | Number of raw points that must separate a calibration point from the previous one for it to be accepted (ignores contact bounce during calibration). |
| calibration_points | Device | The number of points on which the current calibration data is based - maintained by the driver - do not manually update. |
| calibration_points.next | Device | The number of calibration points used for the next calibration. If blank the calibration_points setting is used. Can be set to 4 (default), 9, 11 or 25. |
| calibration_timeout | Device | The number of seconds that the UPDD Calibrate program will wait without input before terminating. Default 10 seconds; 0 waits indefinitely. |
| calibration.force_geometry | Global | screen (the default) or available. The monitor geometry used to place the calibration window: the whole screen, or the available area (the screen minus the menu bar, task bar and similar areas). For example, on a Windows system with an unusual configuration we once found that the available geometry had to be used. |
| calxn / calyn | Device | Calibration X / Y touch co-ordinate n - maintained by the driver - do not manually update. |
Calibration settings that can be defined by the end user can be set using the command line interface, e.g. upddutils nodevice set calibration_confirm 1.
EEPROM calibration storage
Calibration data is normally stored in the UPDD settings file. Some touch devices can also hold calibration data in the touch device memory (EEPROM); for these devices the EEPROM option is shown in the UPDD Console Calibration function. See EEPROM and controller firmware functions.
Defining initial calibration settings
UPDD caters for three device types: USB HID compatible, USB legacy and serial.
For USB HID devices the HID report descriptor read by the driver should specify the co-ordinate range of the device; this is used to set the calibration values and should result in accurate calibration. For the other device types the calibration procedure will need to be performed to set calibration values where calibration is inaccurate.
Once a good set of calibration values is defined it can be saved and restored and can form part of a custom installation procedure where appropriate.
If required, good calibration data can also be preset in our driver production system for a given device configuration, so that an installation package holds accurate calibration data for the same device type. Predefined calibration data is useful if you are setting up systems that use the same device and want the device to be calibrated after installation. This is particularly desirable if you need to avoid running the calibration procedure, such as in an unattended or remote installation.
Saving and restoring calibration settings
The calibration data is stored in a number of UPDD settings, as described above. You can export and import the calibration settings as described in Export, or use the upddutils get and set commands to manipulate them.
For example, to extract all the calibration settings use the following command:
upddutils get cal* (pass >filename to save to a file, e.g. upddutils get cal* >caldata)

Should there be a requirement to reapply these settings at a later stage, say after re-imaging a system and wanting to avoid a manual calibration, use upddutils set as shown below:

If the calibration settings have been saved to a file you could use an editor to add 'upddutils set' and remove the ':' on each line to create a script file that applies the settings.
Multi-monitor considerations
When dealing with a multi controller system it will be necessary to associate the settings with the correct device. In situations where the device handle might change (e.g. over a re-install) use the connection_key setting to identify the device.
In the example below we see the connection_key for device 1:

You should record the connection key at the time of saving and use this to identify the device number at the time of restoring.
For review
calibration.force_geometry: 50129 and the setting's own help text say Linux uses the available geometry by default. In 07_01 calibrate/calibdlg.cpp:173-182 the window starts from the available geometry on every OS and the setting then selects screen or available; the settings file defines "screen" as the default, so screen is used everywhere unless the setting is changed. The Linux exception is therefore dropped here; please confirm on a Linux install.
Left out: the pre/post 6.0.364 table (the simple 2 point calibration of early UPDD 6 builds) and other build numbers.