OPT3101 factory calibration guide and debugging experience
[Copy link]
OPT3101 is TI's new generation of analog front-end ranging chip based on the ToF principle. Users can use the data sheet, design tools, evaluation board and other open source materials provided by TI's official website to achieve flexible customized design according to the application scenario. At the same time, during mass production, each OPT3101 needs to be calibrated. We call this step factory calibration. This article focuses on the specific steps in the factory calibration step, the guide for setting up production line tooling, and sharing debugging experience for common problems to help users successfully complete the mass production of the OPT3101 system.
Table of contents
1. OPT3101 Calibration Overview.................................................................................................................................................................. 2
2. Specific steps for factory calibration................................................................................................................................................. 3
2.1 Introduction to the factory calibration process.................................................................................................................................. 3
2.2 SDK Usage Introduction................................................................................................................................................................................ 5
2.3 Factory Calibration Procedure Introduction................................................................................................................................................ 5
3. Production line tooling construction.................................................................................................................................................. 7
3.1 Recommended tooling solutions.................................................................................................................................................. 7
3.2 Case Description................................................................................................................................................................................ 9
4. Common Problem Debugging Experience.................................................................................................................................................. 11
4.1 Transmit Crosstalk Calibration Failure................................................................................................................................................................ 11
4.2 Phase calibration failed.................................................................................................................................................................................. 12
4.3 EEPROM read and write failure................................................................................................................................................................ 12
5. References................................................................................................................................................................................ 13
1. OPT3101 Calibration Overview
Compared with traditional infrared, ultrasonic and other solutions, OPT3101 has the advantages of high precision, wide viewing angle, and immunity to temperature and light. It can also avoid patent issues in certain application scenarios (such as the obstacle avoidance function of sweeping robots). At the same time, this solution is 1D ToF, which is also competitive in terms of system cost, so its application range is very wide. However, no matter what type of application, one application challenge that OPT3101 must solve is the calibration link.
OPT3101 calibration means: in order to compensate for the negative effects of components, PCB layout and environmental interference on the OPT3101 system, and to ensure the performance and consistency of ranging, the user needs to perform a series of calibration actions on the OPT3101 before normal use, including register operations, data calculation, conversion and storage, etc. OPT3101 calibration can be roughly divided into two types:
The first type of calibration is crosstalk calibration and phase calibration. This type of calibration needs to be performed on each OPT3101, both in the debugging stage and in the mass production stage. We call this step factory calibration. After the factory calibration, the data will be stored in an external non-volatile memory. When the OPT3101 system is powered on again and used normally, the data will be automatically loaded into the OPT3101, so that it can work normally and stably. The general steps are as follows:
查看详情
Figure 1 Schematic diagram of the process before and after OPT3101 leaves the factory
The second type of compensation includes temperature calibration and ambient light calibration. After the design is finalized, this type of calibration only needs to be performed on a small number of sample units (such as 5 pieces) without having to perform the operation on every OPT3101. After confirmation, the calibration parameters can be applied to all other units.
This article focuses on the first type of calibration, which is the calibration that needs to be completed on the automated production line – factory calibration. To achieve this goal, users need to understand two aspects of information: first, what are the specific steps of factory calibration; second, how to achieve factory calibration with mass production tooling. The following will expand on these two aspects in detail.
2. Specific steps for factory calibration
2.1 Introduction to factory calibration process
Factory calibration mainly consists of the following 4 parts:
1) Internal crosstalk calibration: Any noise caused by digital switching signals in the chip itself or surrounding devices can be regarded as internal crosstalk. The calibration step of this crosstalk only needs to be implemented in the program.
2) Transmitter crosstalk calibration: The noise caused by the phototransmitter tube is defined as the transmitter crosstalk. The calibration process of this crosstalk is described as follows:
First, you need to use a black shield (opaque) to block the receiving head to prevent any light from being sampled by the chip receiving head. Common shields include black tape.
Then, read the value of AMP_OUT through I2C in the program. Usually, if the hardware circuit is designed correctly, the value is in the range of several hundred. If it is greater than 1000 or even greater, it means that the crosstalk of the transmitting light is too large, and it is recommended to redesign the hardware circuit first.
Once again, after confirming that the AMP_OUT value is within the normal range, call the SDK program for the crosstalk of the transmitting light. After execution, read the AMP_OUT value again. The receiving head is kept blocked during the whole process.
Finally, usually after calibration, the residual crosstalk value (AMP_OUT) will be within 10 (maybe around 20). However, if the effect is not good after calibration once, you can repeat it a second time. If it still does not work, you need to re-optimize the hardware design. Specific debugging experience will be described in Chapter 4.
3) Phase calibration: After completing the crosstalk calibration, the phase (distance) information needs to be calibrated. The process is described as follows:
First, remove the light shield of the receiving head. Place a reference object in front of the OPT3101 module. In principle, avoid dark colors for the reference object, and keep it smooth and continuous. A typical choice is a white wall. The object should not be placed too far away, and it is necessary to ensure that the distance makes the value of AMP_OUT greater than 10000. The recommended engineering experience value is 100mm~150mm.
Then, call the phase calibration program in the SDK program. After the program is executed, you can directly read the PHASE_OUT at this time to determine whether PHASE_OUT meets the preset distance of the reference object. The conversion relationship between distance and PHASE_OUT is as follows: Distance (mm) = Phase_Out * 0.2287
4) Loading into storage medium: After completing all the above calibrations, you need to load the calibration data into storage medium, such as EEPROM. Simply call the write to EEPROM statement in the SDK.
The above steps can be summarized as follows using a specific flow chart:
查看详情
Figure 2 Factory calibration flow chart
2.2 SDK Usage Introduction
It has been mentioned many times in the description of the calibration steps and flowchart above that the calibration process depends on the implementation of the SDK program. The SDK toolkit is an indispensable part of the development of OPT3101. The following is a basic introduction to the SDK:
1) Purpose of SDK:
The factory calibration process of OPT3101 involves a series of operations, such as configuring the OPT3101 working mode; writing the measured data to OPT3101; reading data from OPT3101; performing data conversion in different variables and registers; writing all calibration-related parameters to the corresponding EEPROM, etc.
SDK is for the register read and write operations related to OPT3101, and various functions (such as calibration) are packaged to provide users with a convenient development toolkit in the form of library files. Without SDK, all the above operations (from underlying code to logic execution) need to be completed by users themselves, which will be a lot of work. Therefore, SDK can greatly speed up the software development process.
2) SDK resource introduction:
The SDK of OPT3101 can be downloaded from the official website:
http://www.ti.com/product/OPT3101/toolssoftware
It contains SDK C++ source files, SDK detailed documentation, etc.
2.3 Introduction to factory calibration procedure
Users can read the following reference code introduction together with the flowchart in Figure 2 to help familiarize themselves with the specific details of the entire process. The following code can be found in the SDK, or in the source file in the reference design TIDA-010021 related links released on the TI official website. The following is an introduction to the factory calibration procedure:
First, the factory calibration procedure requires invoking the following command set:
查看详情
We then analyze the factory calibration procedure step by step:
Step 1: Reset, initialize, and start the internal crosstalk calibration program (SDK)
查看详情
Step 2: Control the tooling to cover the receiving tube with black shielding: User-defined
查看详情
Step 3: Perform the transmit crosstalk calibration procedure.
Cycle through the register configurations of the three transmitters, perform crosstalk calibration, and load calibration data (SDK)
查看详情
Step 4: Remove the light shield from the receiving head and place the reference object at the preset distance.
The user needs to write a value of 150 for the target distance statement in the program; and control the tooling to move the black shield away, and control the position of the curved wall to be 150mm away from the OPT3101 module: User-defined
Step 5: Perform the phase calibration procedure.
Loop through the register configurations of the three transmitting tubes, perform phase calibration, and load phase calibration data; (SDK)
查看详情
Step 6: Load the calibration data into EEPROM.
查看详情
3. Production line tooling construction
3.1 Recommended tooling solutions
The production line tooling needs to meet the above calibration process, and users can design it according to their understanding. The following provides a system framework for reference:
Solution 1: Add an MCU to the ranging module to complete the factory calibration. At the same time, the MCU also executes the ranging program and communicates with the host using IC/UART to output ranging information. The MCU selection needs to have enough storage space to ensure that the SDK statements can be executed and data can be saved.
Advantages: The code for OPT3101 from factory calibration to normal operation ranging is concentrated in one controller, which can simplify development complexity, facilitate updates and upgrades, and realize modular design.
Disadvantage: Additional MCU cost.
查看详情
Figure 3 Tooling Solution 1
Solution 2: Add an EEPROM to the module to store factory calibration data. At the same time, an external MCU is installed on the production line to perform factory calibration steps. The distance measurement program is completed in the MCU on the host side.
Advantages: Best overall cost.
Disadvantages: Software development is more complicated than the first solution, and users are required to complete program writing in two MCUs separately.
查看详情
Figure 4 Tooling Solution 2
In general, for cost-sensitive applications, Option 2 is a better choice. For applications that want to speed up development and achieve modular design, you can consider using Option 1.
3.2 Case Description
Next, for Option 2, we will give an example to illustrate the details of setting up the production line tooling.
The system framework is shown in Figure 3: The OTP3101 module includes an OPT3101 and REERPOM, and the selected model is 24C02.
We chose TI's MSP430FR5994 evaluation board as the MCU for the tooling. The functions of the MSP430 evaluation board are 1) to read and write the OTP3101 registers, calibrate, and write data to the EEPROM. 2) to control the tooling mechanical device and cooperate to complete the calibration steps. 3) to control the human-machine interaction of the user production line (buttons, display, etc.). The I/O control logic of the evaluation board can be defined according to user needs. In this case, we defined STATE, RESET, START, READY. The specific uses are shown in the figure below:
查看详情
Figure 5 Pin definition of MSP430 evaluation board
Internal crosstalk calibration phase: The STATE signal changes from low to high, and the tooling is ready. The RESET signal changes from high to low, and the MSP430 is ready. Start calling SDK statements to perform internal crosstalk calibration.
Transmit crosstalk calibration phase: The START signal changes from high to low, and the MSP430 sends a command to start blocking the receiving head. After the receiving head is completely blocked, the tooling sends a READY command, which changes from high to low, and the blocking action is completed. The SDK starts to call the transmit crosstalk calibration statement to perform crosstalk calibration.
Phase calibration stage: After the crosstalk calibration is completed, the MSP430 issues a command to start removing the obstruction. After the obstruction is completely removed, the tooling issues a READY command, which changes from low to high. The transmitting light is now facing the preset reference object and starts calling the SDK phase calibration statement to perform phase calibration.
Calibration completed: After calibration is completed, the SDK statement is called to load the data into 24C02, and then the MSP430 issues a RESET instruction, which changes from low to high, notifying the tooling to exit the working mode. After the tooling exits the work, the STATE signal changes from high to low, completing a calibration cycle.
The above steps can be mapped one by one using the flowchart in Figure 6 as follows:
查看详情
Figure 6 Flowchart of tooling execution steps
4. Common Problem Debugging Experience
4.1 Transmitter crosstalk calibration failed
As mentioned above, the user can determine whether the transmit crosstalk calibration is successful by judging whether the residual crosstalk value (AMP_OUT) is less than 20. If the judgment fails, debugging can usually be carried out from the following aspects:
1) Hardware circuit problem: If the residual crosstalk value is very high, you need to consider optimizing the hardware design. There are several common approaches:
a) Check the INP and INM matching capacitors; the isolation problem between the digital ground and the analog ground (the impedance of the magnetic bead at 10MHz needs to be large enough, 500 ohms or more is recommended); use low ESR ceramic capacitors in the power supply circuit.
b) The PCB layout is not ideal. Detailed information about the PCB layout can be found in Section 10 of the OPT3101 data sheet and Section 8 of the OPT3101 system design document.
c) Use negative voltage to power the anode of the receiving tube. Using TI charge pump solution, such as LM2664, can realize low-cost and simple negative voltage generation circuit, as shown in the following figure:
查看详情
Figure 7 OPT3101 receiving lamp negative voltage power supply
查看详情
Figure 8 Negative pressure solution based on LM2664 charge pump
2) Optical isolation problem: During the calibration and verification of the transmitter crosstalk, it is necessary to ensure that the receiving tube is always shielded by a light shield. The light shield is usually an object that is opaque to the wavelength used by the system, such as black tape, black plastic parts, etc. For details on the optical isolation between the transmitting tube and the photodiode, you can also check the OPT3101 system design document.
4.2 Phase calibration failed
The phase calibration process of OPT3101 requires the help of a reference object. Therefore, it is necessary to ensure that the reference object is properly placed:
1) The reference object meets the conditions: As mentioned above, the distance of the reference object should be close enough to ensure that the sampled amplitude is high enough (AMP_OUT>10000). At the same time, it should be noted that objects of different materials and colors will also have different effects on the amplitude signal. Finally, the size of the emission current will also have different effects on the amplitude signal. Users need to adjust the above factors according to the actual situation.
2) No mechanical device blocking the view: Due to the numerous mechanical devices on the tooling, some cables, support arms and other devices may block the OPT3101's viewing angle. In addition, in the control of program logic, it is also necessary to ensure that the light shield of the receiving head is fully opened before the program further executes the phase calibration link.
4.3 EEPROM read and write failure
OPT3101 does not have internal non-volatile memory, so all factory calibration data needs to be stored in external non-volatile memory. A common way is external EEPROM. If read and write failures are found, you can check from the following two aspects:
1) Hardware circuit: As shown in the figure below, OPT3101 has two I2C interfaces: I2C_M connects to the external EEPROM, and I2C_S connects to the host MCU. Before the factory calibration is completed, OPT3101 loads data into the EEPROM through I2C_M. After the calibration is completed and OPT3101 is re-powered on and initialized, the EEPROM will automatically write the factory calibration data to the OPT3101 register through I2C_M. OPT3101 gives the ranging data to the host MCU through I2C_S. Therefore, by observing the waveform on I2C_M, it can be determined whether the EEPROM has data read and written. If you need to determine whether the data is correct, you can use the program to intercept the I2C data before and after reading and writing to make a judgment. In addition, since most EEPROMs have a write protection (WP) pin, you need to ensure that the pin has the correct level signal during debugging.
查看详情
Figure 9 Schematic diagram of OPT3101 connecting to EEPROM
2) OPT3101 initialization configuration: Since OPT3101 can be configured as an external EEPROM mode, or not external EEPROM (data is stored in the host MCU memory instead), its configuration needs to be completed in the initialization function, namely initialize();. The method recommended by TI is to use the OPT3101 Configuration Tool provided by TI's official website for design, generate C++ code, and then transplant it to the initialize(); function segment. As shown in the figure below:
查看详情
Figure 10 OPT3101 Configuration Tool settings EEPROM interface
|