DM00122212

DM00122212
DT0034
Design tip
VL6180X early convergence estimate implementation
By Colin Ramrattan
Main components
VL6180X
Proximity and ambient light sensing (ALS) module
Purpose and benefits
This document explains how to implement the Early Convergence Estimate (ECE) feature
of the VL6180X.
It is assumed that customers who use this document can communicate with the VL6180X
2
through I C and are now looking for more information on how to implement the ECE feature
in their application code.
Figure 1. VL6180X device
ECE Overview
ECE refers to a feature within the VL6180X that allows for lower power consumption and
will help in reducing the red glow that may be seen when the device is measuring the range
without a target in the field of view. This feature works by calculating the rate of
convergence 0.5 milliseconds after the measurement has been started. If the return count
rate reported by the device is below the set ECE threshold, the measurement is aborted.
DT0034 Rev 1
1/6
www.st.com
ECE Details and Description
The ECE threshold is a parameter set by the HOST system. This threshold is used by the
internal ranging algorithms to decide to abort a measurement sooner if it seems there is no
target in front of the sensor. To set the ECE threshold, an ECE factor which is decided by
the user is chosen. In a normal use case, this would be an ECE factor of 80%, meaning if
the counts received is 80% of the threshold, then the system will continue with measuring
the distance and there is likely to be a measurement result.
Figure 2 below gives an overview of some the key concepts with ECE.
Figure 2. ALS and Ranging Timeline
Convergence Threshold
Ideal Convergence Rate
ECE Threshold
Signal Return Count
Abort measurement area
0.5ms
Max Convergence Time
To expand on the ECE factor, if the user chooses an 80% ECE factor, the resulting ECE
threshold result is shown in Figure 3 below. What this means is that the system will gather
the return signal count and if these are above 80% of the ideal convergence rate after
0.5ms of the measurement starting then the system will allow the measurement to
continue.
Figure 3. 80% ECE Factor
Convergence Threshold
Ideal Convergence Rate
Signal Return Counts
ECE Threshold
0.5ms
Max Convergence Time
To give another ECE factor example, if the user chooses a 110% factor, the resulting ECE
threshold result is shown in Figure 4 below. What this means is that the system will gather
the return signal count and if these are above 110% of the ideal convergence rate after
0.5ms of the measurement start, then the system will allow the measurement to continue.
DT0034 Rev 1
2/6
www.st.com
This is beneficial if the user wants to have much better power savings as it will only allow a
measurement when there is a material or object in front of the sensor.
Figure 4. 110% ECE Factor
Convergence Threshold
Ideal Convergence Rate
Signal Return Counts
ECE Threshold
0.5ms
Max Convergence Time
ECE Registers:
The following registers in Table 1 are used in the ECE operation.
Table 1.
Overview of registers used in ECE feature
Register Name
SYSRANGE__RANGE_CHECK_ENABLES
SYSRANGE__EARLY_CONVERGENCE_ESTIMATE
SYSRANGE_MAX_
CONVERGENCE_TIME
READOUT__AVERAGING_SAMPLE_PERIOD
SAMPLE_COLLECTED
Register Description
Address
0x02D
This register is used to enable the ECE feature of the
VL6180X.
0x022
Early convergence estimate register. Value in this
register defines the threshold that is used by the ECE
algorithm. This is a two-byte value.
0x01C
This will define the maximum time allowed for a range
measurement to complete. Note: The maximum time
set cannot be more than the ALS inter-measurement
period.
0x10A
This register is used to specify the averaging sampling
period that the VL6180X performs during each range
measurement. This metric is required for the ECE
threshold calculation.
0x109
This register dictates how many samples are collected
for every range measurement average.
The registers shown in Table 1 are a subset of what is used in normal operation of the
VL6180X. The user is advised to refer to the datasheet for further information on how to set
up GPIO modes, interrupt conditions, and other functions of the VL6180X.
DT0034 Rev 1
3/6
www.st.com
ECE Threshold Example
This example below gives an overview of how the ECE threshold is calculated and what is
required to use the ECE threshold feature in the VL6180X.
To enable the ECE feature of the VL6180X, the ECE function needs to be enabled through
the range check enable register. To do this, set bit[0] of
SYSRANGE__RANGE_CHECK_ENABLES Reg 0x02D to ‘1’.
The next step is to calculate the ECE threshold and then store this value in the
SYSRANGE__EARLY_CONVERGENCE_ESTIMATE Reg 0x022. In this example the
variables are stated below and are unsigned integers.
ECE_THRES = ECE threshold that will be written to Reg 0x022.
CONV_THRES = 15360
ECE_FACTOR = 1.05, we chose a 95% ECE factor for this example.
MAX_CONV = Maximum convergence time value read from Reg 0x01C.
PERIOD = This is the averaging sample period read from Reg 0x10A.
SAMPLE = This is the amount of samples read for each averaging period, read from Reg
0x109.
TIME = This is an intermediate variable that is used to calculate the convergence time in
the equation below.
TIME = (SAMPLE + 1) * (24 + 70 + (PERIOD*10)) + 200
CONV_TIME = MAX_CONV * 1000 - TIME
ECE_THRES = ([CONV_THRES] * 500 * ([ECE_FACTOR]*100)) / ([CONV_TIME]*100)
The ECE_THRES value is then written to Reg 0x022. The high byte is written to 0x022 and
the low byte to 0x023.
The example shown above can be applied to the VL6180X after the device has completed
boot up and is waiting for commands. The ECE threshold can be used in single shot or
continuous ranging mode which can be decided by the user.
DT0034 Rev 1
4/6
www.st.com
Support material
Related design support material
MOB-EK2-180-03 Product/ system evaluation board
Documentation
Datasheet: VL6180X - Proximity and ambient light sensing (ALS) module
Revision history
Date
16-June-2014
Version
1
Changes
Initial release
DT0034 Rev 1
5/6
www.st.com
Please Read Carefully
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries
(“ST”) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and
services described herein at any time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST
assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If
any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the
use of such third party products or services, or any intellectual property contained therein or considered as a warranty
covering the use in any manner whatsoever of such third party products or services or any intellectual property contained
therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR
IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT
LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR
EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR
OTHER INTELLECTUAL PROPERTY RIGHT.
ST PRODUCTS ARE NOT DESIGNED OR AUTHORIZED FOR USE IN: (A) SAFETY CRITICAL APPLICATIONS SUCH
AS LIFE SUPPORTING, ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PRODUCT FUNCTIONAL SAFETY
REQUIREMENTS; (B) AERONAUTIC APPLICATIONS; (C) AUTOMOTIVE APPLICATIONS OR ENVIRONMENTS,
AND/OR (D) AEROSPACE APPLICATIONS OR ENVIRONMENTS. WHERE ST PRODUCTS ARE NOT DESIGNED FOR
SUCH USE, THE PURCHASER SHALL USE PRODUCTS AT PURCHASER’S SOLE RISK, EVEN IF ST HAS BEEN
INFORMED IN WRITING OF SUCH USAGE, UNLESS A PRODUCT IS EXPRESSLY DESIGNATED BY ST AS BEING
INTENDED FOR “AUTOMOTIVE, AUTOMOTIVE SAFETY OR MEDICAL” INDUSTRY DOMAINS ACCORDING TO ST
PRODUCT DESIGN SPECIFICATIONS. PRODUCTS FORMALLY ESCC, QML OR JAN QUALIFIED ARE DEEMED
SUITABLE FOR USE IN AEROSPACE BY THE CORRESPONDING GOVERNMENTAL AGENCY.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall
immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in
any manner whatsoever, any liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.
© 2014 STMicroelectronics - All rights reserved
STMicroelectronics group of companies
Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United
States of America
www.st.com
DT0034 Rev 1
6/6
www.st.com
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement