STMicroelectronics STSW-IMG006 User Manual
Oglas
Oglas
UM2072
User manual
P-NUCLEO-53L0A1 pack PC graphical user interface (GUI)
Introduction
This document describes the VL53L0X Software Application and serves as an operational user manual.
The VL53L0X Software Application, STSW-IMG006, is a Windows based GUI application which can be used to operate a VL53L0X ranging sensor device, as part of the VL53L0X evaluation kit, connected by means of a USB interface.
During operation, this application controls the VL53L0X device to perform range distance measurements and present them in real-time on a graphical display.
Throughout this document, the terms VL53L0X App and VL53L0X Device will be used to refer to the VL53L0X Software Application and the VL53L0X Ranging Sensor Device , respectively.
July 2016 DocID029397 Rev 1 1/37 www.st.com
37
Contents
Contents
UM2072
P-NUCLEO-53L0A1 hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
P-NUCLEO-53L0A1 connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
VL53L0X graphical user interface (GUI) user guide . . . . . . . . . . . . . . . . 6
STSW-LINK009: STM32 Nucleo board Windows USB driver installation 6
STSW-LINK007: STM32 Nucleo board PC communication driver . . . . . 7
Successful VL53L0X connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
VL53L0X device not connected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Instantaneous range measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
VL53L0X device selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Range measurement plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Limit checks and adjustable settings . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Measurement data fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Range settings (Inputs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Configure and Reset stats buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Range configuration dialogue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Overriding default settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2/37 DocID029397 Rev 1
UM2072 Contents
Calibration parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Acronyms and abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3
Appendix A Dynamic data log client program . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
DocID029397 Rev 1 3/37
37
Overview
1 Overview
UM2072
The VL53L0X device is a low cost, low power ranging and gesture detection sensor module which performs distance measurements for targets placed within range of the sensor.
Figure 1. VL53L0X device
The P-NUCLEO-53L0A1 is a hardware package that allows evaluation of the VL53L0X device and comprises of an X-NUCLEO-53L0A1 connected to a NUCLEO-F401RE board containing an STM32 Micro-Controller.
The X-NUCLEO-53L0A1contains:
• An expansion board with a VL53L0X located in the center of the expansion board.
• Two left and right optional VL53L0X satellites
• 0.25, 0.5 and 1mm spacers to simulate air gaps
• A cover glass
Figure 2. P-NUCLEO-53L0A1
4/37 DocID029397 Rev 1
UM2072 Overview
The Nucleo-F401RE board is an Arduino TM compatible development STM32 microcontroller providing a platform for embedded software to interface to a VL53L0X device on the expansion board. Communications from a host (e.g. PC) to the STM32 microcontroller, and hence the VL53L0X device, can be achieved by means of an RS232 interface implemented by a VCP (Virtual Com Port).
The P-NUCLEO-53L0A1 is powered from a USB connection, typically from the host PC.
Figure 3. P-NUCLEO-53L0A1 connection
The VL53L0X GUI SW can then run on the host and control the VL53L0X device by transmitting I2C commands across the virtual com port. Software running on the STM32 microcontroller will translate serial packets into I2C transactions and execute them to the device while formulating response packets to communicate the result back to the host (see
Figure 4. Connection between host and P-NUCLEO-53L0A1
P-NUCLEO-53L0A1
NUCLEO-F401RE X-NUCLEO-53L0A1
Virtual Com Port Serial Comms
STM32F401RE
Microcontrolleur I2C Comms
VL53L0X
(Expansion board and two satellites)
DocID029397 Rev 1 5/37
37
VL53L0X graphical user interface (GUI) user guide
2
UM2072
VL53L0X graphical user interface (GUI) user guide
2.1 Compatibility
The VL53L0X GUI SW is compatible with Windows 7, Windows 8 and Windows 10.
2.2 Installation
The VL53L0X GUI SW is compatible with Windows 7, Windows 8 and Windows 10.
Before starting the VL53L0X GUI SW the STSW-LINK009, ST Link VCP drivers, and the
STSW-LINK007, ST Link FW must be installed on the PC.
STSW-LINK009 and STSW-LINK007 can be retrieved from www.st.com
.
2.2.1 STSW-LINK009: STM32 Nucleo board Windows USB driver installation
• On www.st.com home page search for “STSW-LINK009”
Figure 5. STM32 Nucleo board Windows USB driver installation - step 1
STSW-LINK009
• On next page click on “STSW-LINK009”
Figure 6. STM32 Nucleo board Windows USB driver installation - step 2
6/37
• On next page click on “Get software”
Figure 7. STM32 Nucleo board Windows USB driver installation - step 3
DocID029397 Rev 1
UM2072 VL53L0X graphical user interface (GUI) user guide
• Complete and sign license agreement
• From en.stsw-link009.zip, unpack the .zip file and run stlink_winusb_install.bat. This will install the necessary USB drivers to allow communications between the STM32
Nucleo board and the PC.
Figure 8. STM32 Nucleo board Windows USB driver installation - step 4
2.2.2
• Plug a USB cable between the PC and STM32 Nucleo board. Allow the board driver installations to complete before proceeding.
STSW-LINK007: STM32 Nucleo board PC communication driver
• On www.st.com home page search for “STSW-LINK007”
• To install STSW-LINK007 repeat the steps 1 to 3 performed for the installation of the
STSW-LINK009 STM32 Nucleo board Windows USB driver installation.
• Unpack the downloaded stsw-link007.zip file and run STLinkUpgrade.exe.
• Ensure the STM32 Nucleo development board is connected via the USB port.
• Click 'device connect' on the dialogue and confirm the board has successfully connected.
• When prompted to upgrade to the latest version check that the suggested version is later than the current firmware version then, click 'YES’ to proceed.
DocID029397 Rev 1 7/37
37
VL53L0X graphical user interface (GUI) user guide UM2072
Figure 9. STM32 Nucleo board communication driver with PC installation - step 4
3
2
1
The user is not required to have administrator privileges to install this software, however the default installation location in ‘Program Files’ may require to be changed to specify an accessible location on the PC file system. This can be performed by selecting the “change” button when presented with the dialogue shown in
Figure 10. Installation location folder
8/37 DocID029397 Rev 1
UM2072 VL53L0X graphical user interface (GUI) user guide
Following successfully installation, the VL53L0X GUI SW tool can be started by clicking the
VL53L0X desktop icon.
Figure 11. VL53L0X desktop icon
2.3.1
Additionally, startup can be performed by navigating the start menu, selecting
Start->All Programs->STMicroelectronics->VL53L0X->VL53L0X
Successful VL53L0X connection
Immediately following startup, the VL53L0X GUI SW will attempt to connect to the device and read back the part ID.
If the VL53L0X FW is not running on the STM32 Nucleo, the VL53L0X GUI SW will flash this software to the STM32 Nucleo board, then proceed to connect.
If the P-NUCLEO-53L0A1 is connected, and detection is successful, the primary controls
will be enabled on the user interface and the tool will be ready for operation (see Figure 12 ).
Figure 12. VL53L0X device connected
DocID029397 Rev 1 9/37
37
VL53L0X graphical user interface (GUI) user guide UM2072
Caution: As soon as the PC GUI software runs, the VL53L0X expansion board display the message
shown in Figure 13 and values are only visible on the PC screen.
Figure 13. Message displayed when GUI is in use
2.3.2 VL53L0X device not connected
If the VL53L0X Device is not detected, primary controls on the user interface will be
disabled as shown in Figure 14 .
Figure 14. VL53L0X device not connected
10/37
Troubleshooting
If the VL53L0X has not been detected, there are a number of possible reasons for this.
• STM32 Nucleo board not connected
– Please ensure that the P-NUCLEO-53L0A1 is connected to the PC on an active
USB port.
• Removable device drivers not installed
– The STM32 Nucleo board will be visible to the host PC as a removable device, the first time the board has been connected to the PC.
DocID029397 Rev 1
UM2072 VL53L0X graphical user interface (GUI) user guide
– Please ensure a short delay is allowed to elapse as the necessary drivers autoinstall to the PC.
– Normally the VL53L0X GUI SW will be required to restart.
– A reboot of the PC may be required.
• VCP device driver (STSW-LINK009) not installed
– The communications interface between the host PC and STM32 Nucleo board over USB is implemented as a Virtual Com Port.
– Please ensure the correct ST Link VCP (STSW-LINK009) drivers are installed on the host PC. This can be verified in device manager
(Mouse right button on “Computer” icon, select “property” then click on “Device
manager” and expand “Ports (COM & LPT) section”) (see Figure 15 ).
– A reboot of the PC may be required.
Figure 15. USB device driver
• X-NUCLEO-53L0A1 expansion board not connected correctly
– The user should ensure that the X-NUCLEO-53L0A1expansion board is correctly seated on the STM32 Nucleo board, as illustrated previously in
The ranging tab provides controls to perform ranging and presents the measurement data in real time in both graphical and textual, numerical formats (see
).
Figure 16. Ranging tab
DocID029397 Rev 1 11/37
37
VL53L0X graphical user interface (GUI) user guide
2.4.1 Signal strength plot
UM2072
The signal strength plot, shown in Figure 17 , displays in real time the signal strength
measurements, expressed in ‘Mega-Counts-Per-Second’, where a ‘count’ is considered to be a ‘photonic unit’ reflected from the target and detected by the VL53L0X ranging sensor.
The actual quantifiable number of photons represented by each count is beyond the scope of this document.
Figure 17. Signal strength plot
2.4.2
Vertical axis adjustment
The vertical axis of the graph is adjustable to allow the user to observe the plot in a larger scale when the signal rate is low.
The control for this is detailed in the
Section 2.5: Range configuration dialogue
section.
Data set adjustment
The total number of measurements displayed on the graph is adjustable, allowing the user to view a short data set with high resolution or a larger data set to observe the measurements over a longer capture period.
The control for adjusting the data set is detailed in the
Section 2.5: Range configuration dialogue
section.
Instantaneous range measurement
During ranging, the instantaneous range distance measurement can be observed from a large data field in the centre of the display. An adjustable median filter is applied to this data field (see
).
Figure 18. Ranging measurement data field
2.4.3 VL53L0X device selection
If multiple VL53L0X devices are available on the expansion board, these can be activated by means of the device selection control as shown in
.
The center device is that which is embedded on the expansion board, whereas left and right options refer to the satelite boards. Please refer to the labels on the display of the expansion
12/37 DocID029397 Rev 1
UM2072 VL53L0X graphical user interface (GUI) user guide board to identify the correct VL53L0X under test (see
).
The VL53L0X GUI SW does not currently provide the facility to range with multiple devices simultaneously.
The user should ensure the satellite board is correctly connected before attempting ranging.
Figure 19. VL53L0X device selection
Figure 20. Message displayed on the expansion board versus the VL53L0X under test
The range measurement plot, shown in
, displays in real time, the distance measurements, expressed in cm. In certain modes there may be a median filter applied to the data to eliminate noise. This is detailed in the
Section 2.5: Range configuration dialogue
section.
DocID029397 Rev 1 13/37
37
VL53L0X graphical user interface (GUI) user guide
Figure 21. Range measurement plot
UM2072
14/37
Vertical axis adjustment
The vertical axis of the graph is adjustable. The control for this is detailed in the
section.
Data set adjustment
The total number of measurements displayed on the graph is adjustable. The control for adjusting the data set is detailed in the
Section 2.5: Range configuration dialogue
section.
There exists some controls permitting application and adjustment of the limit checks performed on range measurements along with other settings.
These controls are only available in ‘Expert’ mode, as detailed in the Table 6
.
Figure 22. Limit checks and adjustable settings
These controls are also present on the configuration dialogue but are provided on the ranging tab to provide easy access. The
Section 2.5: Range configuration dialogue
provides detailed information on the operation of these controls.
There exists three control buttons providing operation of the device.
Figure 23. Control buttons
DocID029397 Rev 1
UM2072
2.4.7
VL53L0X graphical user interface (GUI) user guide
Start
Click on “Start” button to commence live ranging and display.
Stop
Click on “Stop” button to stop ranging.
Reset
Click on the Reset button to perform a hard reset of the VL53L0X device and soft reset of the application as follows
• Performs a power cycle of the device.
• Clears both signal rate and range data plots.
• Resets the communications interface to the device.
• Resets internal data within the application.
Measurement data fields
Figure 24. Measurement data fields (outputs)
The measurement data fields display instantaneous, live range measurement data during
ranging, described in the Table 1 .
Data field
Ranging Rate (Hz)
Status
Table 1. Data fields (outputs)
Description
Achieved frequency of range measurements performed, expressed in Hz.
Textual field, reporting the success status of range measurements:
– “Target Detected”: Successful range measurement achieved.
– “No Target”: No range measurement achieved.
DocID029397 Rev 1 15/37
37
VL53L0X graphical user interface (GUI) user guide UM2072
Data field
Table 1. Data fields (outputs) (continued)
Description
Error
Corrected Range (cm)
Error code detailing the cause of any failed measurements:
– 0x00: Range valid
– 0x01: Sigma fail
– 0x02: Signal fail
– 0x03: Min range fail
– 0x04: Phase fail
– 0x05: Hw fail
– 0xFF: No update
‘Real’ distance measurement, expressed in cm, with any part to part calibration corrections applied.
Mean (cm)
Std Dev (cm)
Mean range measurement, expressed in cm, calculated over a defined data
set of adjustable length. See section Section 2.5: Range configuration dialogue
to adjust the data set size.
The standard deviation of range measurements from the mean, expressed in cm and calculated over the same data set as that used to calculate the mean.
Rtn Signal Rate (Mcps)
Return signal rate measurement, expressed in Mcps. This represents the amplitude of the signal reflected from the target and detected by the device.
Rtn Amb Rate (Mcps)
Sigma Estimate (mm)
Return ambient rate measurement, expressed in Mcps. This represents the photonic activity detected by the device not from a target but due to ambient lighting.
This is an advanced internal parameter and it is beyond the scope of this document to provide more detailed information, however a sigma estimate limit check exists as part of range measurement validation.
2.4.8 Range settings (Inputs)
Figure 25. Applied settings (inputs)
16/37 DocID029397 Rev 1
UM2072 VL53L0X graphical user interface (GUI) user guide
The range settings data fields display the current applied settings, either applied by default
or provided by user input from the Section 2.5: Range configuration dialogue . These are
described in
Table 2
Data field
Table 2. Data fields (inputs)
Description
Mode
Performance Mode
Range Offset (mm)
Cross-Talk Comp
Factor
Timing Budget (ms)
Signal Rate Limit
(Mcps)
Ranging mode selection:
* Single ranging :
- Ranging is performed as a series of “single shot” measurements, each one following on immediately from the last.
- Ranging measurements are managed by the host application, i.e. the GUI, decides when each measurement commences.
* Continuous ranging :
- Ranging is performed as a series of “back-to-back” measurements managed by the device.
- The host initiates this with a single “start” command and then has the responsibility to ensure all measurement data is retrieved from the device.
* Timed ranging :
- Ranging is performed as a series of measurements performed at fixed time intervals, defined by the inter-measurement period.
- The host initiates this with a single “start” command and then has the responsibility to ensure all measurement data is retrieved from the device.
Mode selection to customize ranging performance for specific use
cases.See Section 2.5: Range configuration dialogue
for more detailed information.
* High speed :
- Fast ranging speed, standard distance ranging with standard precision.
* Long range :
- Standard ranging speed, longer distance ranging with standard precision.
* High accuracy :
- Slower ranging speed, standard distance ranging with high precision.
Fixed distance value, expressed in mm and added to all range measurements, to correct any range measurement error existing on a part-
to-part basis. see Section 2.5: Range configuration dialogue
Correction applied to compensate the effects of cross talk from glass in front of the sensor.
Total integration time for each measurement, expressed in ms.
The range measurement comprises of some initial checks, followed by a short pre-range measurement, then the final, full ranging measurement.
This is detailed in the Section 2.5: Range configuration dialogue .
Minimum signal rate permissible from the range measurement, to determine that a valid target has been detected. Expressed in Mcps.
Sigma Estimate Limit
(mm)
Ignore Threshold
(Mcps/Spad)
Maximum sigma estimate permissible for a valid range measurement.
This is an advanced internal parameter and it is beyond the scope of this document to provide more detailed information.
Signal rate minimum threshold. Measurements with signal rates below this value are ignored. This ensures that false measurements are not made due to reflection from the housing.
Inter-Meas Period (ms)
Fixed inter-measurement period between range measurements performed in timed mode.
This field is only displayed during timed period.
DocID029397 Rev 1 17/37
37
VL53L0X graphical user interface (GUI) user guide
2.4.9 Configure and Reset stats buttons
Figure 26. Configure and Reset stats buttons
UM2072
Two buttons exist towards the lower right hand corner of the Ranging tab – ‘Configure’ and
‘Reset stats’.
Configure
Clicking this button will load the Range Configuration dialogue, allowing the user to view and adjust a number of settings.
Reset stats
Clicking this button resets the data filter used to calculate statistical data such as the mean and standard deviation.
18/37
If data logging is enabled, range measurement data will be saved to file during ranging. Data log selection is detailed
The range measurement data log contents are detailed in the Table 3 .
Data item
Count
Timestamp_ms
DataLogCount trueRange_cm trueRangeMean
TrueRangeStdDev signalRate_Mcps sigmaEstimate_mm rtnAmbienRate_Mcps timingBudget_ms status
Table 3. Data fields (inputs)
Description
Range measurement identifier, starting at measurement 1 and incrementing in steps of 1.
Measurement timestamp in ms
Data log index starting at 0 and increasing in steps of 1.
Real distance measurement in cm, after offset, cross-talk and any other correction has been performed.
Mean true range value in cm, calculated over the last n measurements.
n = Range Statistic Filter Size parameter, set in the
Section 2.5: Range configuration dialogue
.
Standard deviation of the true range value in cm, calculated over the last n measurements.
n = Range Statistic Filter Size parameter, set in the
Section 2.5: Range configuration dialogue
.
Measured signal rate, expressed in Mcps.
Estimate sigma, expressed in mm, for the return rate.
Ambient rate measurement performed on the return array, with no active photon emission, so as to measure the ambient signal rate due to noise.
Expressed in Mcps.
Total time period elapsed to perform a range measurement, expressed in ms.
Range measurement status. 0 means success. Anything else means error.
DocID029397 Rev 1
UM2072
Data item errorCode actualRtnSpadsint offset_mm xTalkCompFactor freqHz
VL53L0X graphical user interface (GUI) user guide
Table 3. Data fields (inputs) (continued)
Description
Error code for the current range measurement.
Actual number of return SPADs enabled in the current measurement
Fixed distance value, expressed in mm and added to all range measurements, to correct any range measurement error existing on a partto-part basis.
Correction applied to compensate the effect of cross-talk from glass in front of the sensor.
Rate of achieved range measurements.
2.5 Range configuration dialogue
Figure 27. Range configuration dialogue
The range configuration dialogue provides the user with the ability to view and adjust a number of settings affecting ranging performance and also configuration of the features provided by the VL53L0X GUI SW. This section describes these settings in detail.
For most settings, there exists a default value which is applied when the checkbox is clear and an override value which can be applied when checkbox is set. When in the override state, the adjacent (up/down) control will be enabled, allowing the user to manually provide input. Clearing the checkbox again will revert back to the default value, disabling the control again while retaining the user value in memory for the user to re-apply if they so wish.
Warning: Most settings are adjusted using an ‘up/down’ control, which allows the user to increment and decrement by fixed values.
These controls also allow direct input by typing a value. In
DocID029397 Rev 1 19/37
37
VL53L0X graphical user interface (GUI) user guide UM2072 this situation, the control is being used as an edit box, therefore the user must press ‘enter’ for the input value to be applied.
2.5.2 Settings
GUI settings
These settings provide adjustment of the graphical user interface configuration.
Setting
Table 4. GUI settings
Description
Signal Rate Upper (MCPS)
Signal rate graph vertical axis upper limit.
Adjusting the upper and lower limits of the signal rate graph allows the user to view the plot in a larger scale if the plot values are not within the defined range.
Signal Rate Lower (MCPS) Signal rate graph vertical axis lower limit.
Range Upper (cm)
Range graph vertical axis upper limit.
Adjusting the upper and lower limits of the range graph allows the user to view the plot in a larger scale if the plot values are not within the defined range.
Range Lower (cm)
Graphical Plot Total Samples
Range graph vertical axis lower limit.
Data set size for the signal rate and range graphical plots.
This setting allows the user to adjust the total number of measurements retained in memory and displayed on the graphs.
During full ranging, the user may wish to view a small data set, e.g. 50 samples, allowing small changes in measurements to be observed.
During fast ranging, at very high speeds, the user may wish to view a larger data set e.g. 400 samples, so that observable target movements do not vanish immediately from the display.
Range Display Smoothing
Range Statistics Filter Size
Defines the number of range data samples uses in the median filter applied to eliminate noise.
Consequently the smoothed range measurements get displayed in the Range(cm) field on the ranging tab and also on the ranging graph.
Data set size used to calculate the statistical data, i.e. mean and standard deviation.
20/37 DocID029397 Rev 1
UM2072 VL53L0X graphical user interface (GUI) user guide
Data log settings
These settings provide adjustment of the parameters relating to the data log feature.
Setting
Total Samples
Table 5. Data log settings
Description
Total samples captured in the data log.
Data log samples can be captured to file as:
– a fixed size data set (non-zero number), logging all data from the start of the ranging cycle until a set number of samples has elapsed.
– continual logging for the entire ranging duration (zero), logging all data from the start of the ranging cycle until the user clicks the stop button to halt ranging.
DocID029397 Rev 1 21/37
37
VL53L0X graphical user interface (GUI) user guide UM2072
Range settings
These settings provide adjustment of the device parameters applied during ranging.
Setting
Ranging Mode
Performance mode
Ignore Threshold
Table 6. Range settings
Description
Ranging mode selection:
Ranging can be performed in different modes, which differ slightly in the sequence of actions performed in each range measurement.
Available modes are detailed as follows.
* Single Ranging :
- Ranging is performed as a series of 'single shot' measurements each one following on immediately from the last.
- Ranging measurements are managed by the host, which decides when each measurement commences.
* Continuous Ranging :
- Ranging is performed as a series of 'back-to-back' measurements managed by the device.
- The host initiates this with a single 'start' command and then has the responsibility to ensure all measurement data is retrieved from the device.
* Timed Ranging :
- Ranging is performed as a series of measurements performed at fixed time intervals, defined by the inter-measurement period.
- The host initiates this with a single 'start' command and then has the responsibility to ensure all measurement data is retrieved from the device
Mode selection to customize ranging performance for specific use cases.
* Expert :
– During this mode, the user has the ability to adjust any provided setting. In other modes, most of the setting controls will be disabled to the user.
– During this mode, the limit check controls and other adjustable settings will be displayed on the ranging tab immediately under the ranging graphical plot, as detailed earlier in this document.
* High Speed :
– Fast ranging, standard distance ranging with standard precision.
* Long Range:
– Standard ranging speed, longer distance ranging with standard precision.
– This is the default mode.
* High Accuracy :
– Slower ranging speed, standard distance ranging with high precision.
– During this mode, the graphical range plot will display smoothed data, i.e. range measurements with a median filter applied over a number of samples, defined by the ‘Range Display Smoothing’ control.
Signal rate minimum threshold. Measurements with signal rates below this value are ignored. This ensures that false measurements are not made due to reflection from the housing.
22/37 DocID029397 Rev 1
UM2072 VL53L0X graphical user interface (GUI) user guide
Setting
Signal Rate Limit (MCPS)
Sigma Estimate Limit (mm)
Timing Budget (ms)
Range Offset (mm)
Signal Rate X-Talk
Compensation (MCPS)
Inter-Meas Period (ms)
VCSEL period
Table 6. Range settings (continued)
Description
Signal Event Limit parameter used in the minimum signal rate
(pre)check.
Increasing this parameter tightens the criteria used to decide if a full range measurement is performed.
Maximum Sigma estimate permissible for a valid range measurement.
This is an advanced internal parameter and it is beyond the scope of this document to provide more detailed information.
Total integration time for a range measurement, expressed in ms.
Depending on the ranging mode, there may be one or two submeasurements, performed. The total integration time accounts for all sub-measurements performed and any additional checks.
Reducing the integration time for range measurements will increase the measurement sample rate but with possibly degraded ranging performance.
Fixed distance value, expressed in mm and added to all range measurements, to correct any range measurement error existing on a part-to-part basis.
Correction applied to compensate the effects of CrossTalk from glass in front of the sensor.
Fixed Inter-measurement period between range measurements performed in timed mode.
This field is only displayed during timed mode.
Specifies the VCSEL period of the pre-range and final range measurement, expressed as a multiple of PLL clock cycles.
Increasing the VCSEL period will also increase the maximum ranging distance of the VL53L0X device.
Two options are provided:
– 14/10:Normal Ranging
– 18/14:Long Ranging
It is beyond the scope of this document to provide further information relating to this parameter.
Clicking on the erase button causes the stored settings to be erased. The current settings will still be applied and the user has the option to restore the saved settings by clicking the save button or else reverting to device defaults by resetting the device, by means of the reset button on the main dialogue.
Clicking on the Save button will result in the currently applied user settings to be stored to file, and re-applied automatically the next time the application is started using the same device.
DocID029397 Rev 1 23/37
37
VL53L0X graphical user interface (GUI) user guide
Figure 28. Data log tab
UM2072
2.6.1
24/37
Static data logging
The data log feature allows measurement data to be written to .csv (comma separated values) files during a ranging cycle. Then, subsequently they can be observed by loading into a spreadsheet application, or loaded into the data log tab where the data can be plotted on a graphical chart.
All measurement data is logged during the measurement period.
Enabling the data log
Data logging can be enabled by checking the ‘Enable Data Log’ checkbox. Then, the next time the user clicks ‘Start’ on the ranging tab a new file will be created with a unique date and time stamp to record the data. Measurement data will be recorded to the file in a comma delimited format, with an associated timestamp for each measurement.
Continual and fixed size data logging
There are two modes of data log operation : fixed and continual.
During continual mode, data associated with all range measurements is recorded for the entire ranging cycle.
During fixed mode, data is recorded until the sample count reaches a defined limit, then logging stops. This limit is defined as part of the settings adjustable from the configuration dialogue.
DocID029397 Rev 1
UM2072 VL53L0X graphical user interface (GUI) user guide
Data log storage location
Data logs are stored in the user application area on the PC file system, e.g.
C:\Users\ yourusername \AppData\Local\STMicroElectronics\VL53L0X\DataLog\RangeData\
Viewing data logs
Logged data can be plotted in isolation, or together on charts within the data log tab.
Buttons File1 and File2 can be used to load either two different files, or the same file twice.
This allows the user to compare the same data between two different ranging cycles, or else view different data within the same file on separate charts.
Once loaded, the user will be presented with a list of available data items that can be plotted, each once with a checkbox. The user may then check the items they wish to chart and the plots will be drawn.
When plotting data, the chart scales will automatically be adjusted to accommodate the data set provided, therefore the user should ensure their account for this when plotting multiple data plots on the same chart.
If data items have significantly different scales, they should be plotted on separate charts, or else plotted using a dual axis.
Dual axis
Checking either of the Dual Axis checkboxes will allow two vertical axes to be created on chart 1 or chart 2, depending on the selection. The second selected data item will be displayed against the second axis.
These checkboxes are enabled when two or more data items are selected.
File merge
When two different files are loaded, the Merge check box causes the data within both files to be merged into a single chart.
The dynamic data log feature allows another application to access the data log live during ranging.This option becomes available when data logging is selected as shown in
.
Figure 29. Dynamic data log selection
Once the dynamic data log option is selected, the data can be accessed by setting up a named pipe client connection to ‘VL53L0X_Data’. This is illustrated in the example program
shown in Appendix A: Dynamic data log client program
.
Protocol
The GUI application sets up a server pipe, named VL53L0X_Data and waits for connection.
When the client connects during ranging, the application will transmit the header information
DocID029397 Rev 1 25/37
37
VL53L0X graphical user interface (GUI) user guide UM2072 for the data, followed by the data, for the duration of ranging and while the client is connected.
The protocol for transmitting data across the pipe is that the server will transmit two bytes
(MSByte followed by LSByte), defining the data length followed by the data itself.
Data format
The dynamic data log is transmitted in CSV format and is described in the Table 7 .
Data item
Table 7. Dynamic data log
Description
Count
Range measurement identifier, starting at measurement 1 and incrementing in steps of 1
Timestamp_ms trueRange_cm signalRate_Mcps
Measurement timestamp in ms.
Real distance measurement, in cm, after offset, cross-talk and any other correction has been performed.
Measured signal rate, expressed in MCPS (mega counts per sec).
actualRtnSpadsInt Actual number of return SPADs enabled in the current measurement.
The calibration tab guides the user through the procedures necessary to determine the calibration parameters to be applied during ranging for optimum performance.
Figure 30. Calibration tab
26/37 DocID029397 Rev 1
UM2072 VL53L0X graphical user interface (GUI) user guide
There are two calibration parameters to be applied, namely Range Offset and Crosstalk
Compensation Factor. These are required to be applied on part-to-part basis.
Range offset
The range offset is a fixed distance value, expressed in mm, and added to all range measurements, to correct any range measurement error existing.
Typically the range offset will be retrieved from NVM by the device and applied by default.
Sometimes this may be required to be overridden by a new calibrated parameter.
To start a range offset calibration you have to tick the check box “Range Offset (mm)” in the
“Offset Controls:” part of the Calibration tab.
Figure 31. “Range Offset (mm)” check box
Crosstalk compensation factor
When there is glass in front of the VL53L0X device, this will introduce crosstalk, resulting in some loss of signal. The effects of crosstalk on ranging are particularly evident when ranging against low reflective surfaces (e.g. grey or black object) at far distances.
Crosstalk compensation can be applied to correct these effects and the key parameter involved in the calculation is the Crosstalk Compensation Factor.
The magnitude of crosstalk existing is both a property of the glass and of the distance between the VL53L0X device and the glass. Therefore it is likely that the required crosstalk compensation factor will vary slightly on a part-to-part basis.
To start a Crosstalk compensation you have to tick the check box “Signal Rate X-Talk
Compensation (mcps)” in the “X-Talk Compensation Controls:” part of the Calibration tab.
Figure 32. “X-Talk Compensation (mcps)” check box
DocID029397 Rev 1 27/37
37
VL53L0X graphical user interface (GUI) user guide UM2072
The calibration states and transitions are shown in the
and
as follows
• When neither offset or crosstalk has been calibrated, the state will be ‘No Calibration’.
• When the offset is calibrated but not the crosstalk, the state will be ‘Offset Only
Calibration’.
• When both offset and crosstalk are calibrated, the state will be ‘full calibration’.
• Crosstalk cannot be considered to be calibrated unless offset is calibrated beforehand.
• For either crosstalk or offset parameters the calibration state can be achieved by either
– Manual calibration
– Auto Calibration
• If the user does not wish to perform calibration for either parameter they select to apply the default values by clearing the relevant “Range Offset (mm)” and “Signal Rate X-
Talk Compensation (mcps)” check boxes.
28/37 DocID029397 Rev 1
UM2072 VL53L0X graphical user interface (GUI) user guide
Figure 33. Range offset calibration sequence
DocID029397 Rev 1 29/37
37
VL53L0X graphical user interface (GUI) user guide
Figure 34. X-Talk compensation calibration sequence
UM2072
30/37
On the right side of the panel are a number of Action buttons, which are used to perform the calibration steps.
Cal Offset:
This button will be enabled when the offset is in the UnCalibrated state. The user should click on this if they wish to perform Manual or Auto Calibration.
Cal X-Talk:
This button will be enabled when the Crosstalk Compensation is in the UnCalibrated state and the Offset is not in the UnCalibrated state. The user should click on this if they wish to perform Manual or Auto Calibration.
DocID029397 Rev 1
UM2072 VL53L0X graphical user interface (GUI) user guide
Auto-Cal:
This button will be enabled when the user has clicked either of the ‘Cal Offset’ or ‘Cal X-Talk’ buttons. Instructions will be provided for calibrating either the Offset or the Crosstalk depending on the selection.
Once the instructions are carried out, the user should click the button to proceed with the
Auto calibration and wait for the result.
Manual-Cal:
This button will be enabled when the user has clicked either of the ‘Cal Offset’ or ‘Cal X-Talk’ buttons. If the user wishes to manually provide the calibration parameter, corresponding to their calibration selection, they can do so using the either the Range Offset or X-Talk
Compensation input controls on the lower half of the display.
When the manual input has been carried out, the user should click Manual-Cal to proceed and the user input will be retained as the calibrated parameter.
Reset:
This button resets the calibration status to the default state for both parameters. Any calibrated values are erased from memory. The override values are also set to match the default. The same applies to the ‘Cal Height’ parameters.
Save:
This button should be clicked to save the current calibration values and status such that they will be re-applied the next time the VL53L0X GUI SW is run with this part.
This action also saves the all applied settings, in precisely the same manner as the Save button on the configuration dialogue.
Note : This feature is useful if the user wishes to perform a reset followed by a new calibration. If they decide the old parameters were better, they can restart the VL53L0X GUI
SW to reinstate the old settings.
DocID029397 Rev 1 31/37
37
Acronyms and abbreviations
3 Acronyms and abbreviations
Acronym / Abbreviation
Table 8. Acronyms and abbreviations
Definition
DSS
EVK
GUI
HID
MCPS
MSRC
ROI
SNR
SPAD
TCC
X-Talk
Dynamic SPAD Selection
Evaluation Kit
Graphical User Interface
Human Interface Devices
Mega Counts Per Second
Minimum Signal Rate Check
Region Of Interest
Signal-to-Noise Ratio
Single Photon Avalanche Diode
Target Centre Check
Cross talk
UM2072
32/37 DocID029397 Rev 1
UM2072 Dynamic data log client program
Appendix A Dynamic data log client program
using System; using System.IO; using System.IO.Pipes; using System.Text; using System.Security.Principal; using System.Diagnostics; using System.Threading;
{ namespace DynamicDataLogTest
{ public class PipeClient
private static int numClients = 4;
public static void Main(string[] Args)
{
NamedPipeClientStream pipeClient =
new NamedPipeClientStream(".", "VL53L0X_RangeData",
PipeDirection.In, PipeOptions.None);
Console.WriteLine("Connecting to server...\n");
pipeClient.Connect();
StreamString ss = new StreamString(pipeClient);
while (true)
{
try
{
Console.Write(ss.ReadString());
}
catch(System.Exception e)
{
break;
}
}
pipeClient.Close();
// Give the client process some time to display results before exiting.
Thread.Sleep(4000);
}
DocID029397 Rev 1 33/37
37
Dynamic data log client program
}
// Defines the data protocol for reading and writing strings on our stream public class StreamString
{
private Stream ioStream;
private UnicodeEncoding streamEncoding;
public StreamString(Stream ioStream)
{
this.ioStream = ioStream;
streamEncoding = new UnicodeEncoding();
}
public string ReadString()
{
string retStr = "";
try
{
int len;
len = ioStream.ReadByte() * 256;
len += ioStream.ReadByte();
byte[] inBuffer = new byte[len];
ioStream.Read(inBuffer, 0, len);
retStr = streamEncoding.GetString(inBuffer);
}
catch(System.Exception e)
{
throw;
}
return retStr;
}
public int WriteString(string outString)
{
int length = 0;
try
{
byte[] outBuffer = streamEncoding.GetBytes(outString);
int len = outBuffer.Length;
UM2072
34/37 DocID029397 Rev 1
UM2072
}
if (len > UInt16.MaxValue)
{
len = (int)UInt16.MaxValue;
}
ioStream.WriteByte((byte)(len / 256));
ioStream.WriteByte((byte)(len & 255));
ioStream.Write(outBuffer, 0, len);
ioStream.Flush();
length = outBuffer.Length + 2;
}
catch(System.Exception e)
{
throw;
}
return length;
}
}
Dynamic data log client program
DocID029397 Rev 1 35/37
37
Revision history
Date
11-Jul-2016
Table 9. Document revision history
Revision Changes
1 Initial release.
UM2072
36/37 DocID029397 Rev 1
UM2072
IMPORTANT NOTICE – PLEASE READ CAREFULLY
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on
ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers’ products.
No license, express or implied, to any intellectual property right is granted by ST herein.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.
© 2016 STMicroelectronics – All rights reserved
DocID029397 Rev 1 37/37
37
Prenesi
Oglas