Multi-channel Vl53l0X laser ranging calibration method and drive

文档序号:1002400 发布日期:2020-10-23 浏览:13次 中文

阅读说明:本技术 一种多路Vl53l0X激光测距校准方法及驱动 (Multi-channel Vl53l0X laser ranging calibration method and drive ) 是由 王心源 于 2020-08-06 设计创作,主要内容包括:本发明涉及多路传感器驱动技术领域,尤其是一种多路Vl53l0X激光测距校准方法,本方法可以达到无需人工干预实现Vl53l0X激光测距模块的驱动和校准,自校准功能可以极大程度的减少因为安装位置等因素造成的系统误差;并且在校准过后可以存储校准数据,掉电不丢失,无需每次上电都进行校准可以进行快速响应。本方法可以通过串口实时监测测量数据,若发现数据异常可以发送校准命令校准异常传感器,可以灵活适应各种场景;本发明的方法通过合理规划flash存储区域以节省flash空间并且可以反复擦写而不影响主程序;本发明还提供一种多路Vl53l0X激光测距校准驱动。(The invention relates to the technical field of multi-channel sensor driving, in particular to a multi-channel Vl53l0X laser ranging calibration method, which can achieve the purpose of realizing the driving and calibration of a Vl53l0X laser ranging module without manual intervention, and the self-calibration function can greatly reduce system errors caused by factors such as installation positions and the like; and the calibration data can be stored after calibration, the power failure is not lost, and the quick response can be realized without calibrating every time of power-on. The method can monitor the measurement data in real time through the serial port, and can send a calibration command to calibrate the abnormal sensor if data abnormality is found, so that the method can be flexibly suitable for various scenes; the method of the invention saves the flash space by reasonably planning the flash storage area and can be repeatedly erased without influencing the main program; the invention also provides a multi-channel Vl53l0X laser ranging calibration drive.)

1. A multi-channel Vl53l0X laser ranging calibration method and drive are characterized in that: comprises the following steps of (a) carrying out,

1) the I2C address of the Vl53l0X is lost after restarting, so that the MCU needs to configure an address for a designated module before initialization, the designated Vl53l0X laser ranging module is enabled through a specific chip selection pin, only the module can communicate with the MCU at the moment, and the address of the module is configured through an I2C bus and subsequent configuration is carried out;

2) inquiring the calibration information in a flash storage area inside the MCU corresponding to the Vl53l0X module address, and reading the compensation parameters from the corresponding flash area for configuration if the calibration information is calibrated;

3) if no calibration rule is available, starting a self-calibration program for preventing installation errors and errors caused by external environment, wherein the self-calibration program comprises the following steps:

(1) comparing the preset distance with the measured distance by a Vl53l0X module, and returning compensation parameters for correction after each measurement;

(2) repeating the calibration process for 3 times and respectively storing the measurement results;

(3) calculating the variance of the measurement results for 3 times, and if the variance is smaller than a threshold value, successfully calibrating;

(4) the MCU obtains the compensation parameters and then stores the compensation parameters in a flash area of the corresponding address of the module;

4) reading data from each Vl53l0X module in a circulating mode;

5) and the serial port outputs the measurement data.

2. A multi-lane Vl53l0X laser range calibration drive, using a multi-lane Vl53l0X laser range calibration method of claim 1, wherein: the calibration drive comprises a control part and a sensor part, wherein the control part adopts an STM32F103C8T6 chip, and the sensor part adopts a plurality of Vl53l0X laser ranging modules.

3. The multi-channel Vl53l0X laser ranging calibration drive of claim 2, wherein: the physical laser ranging module is fixed on the driving platform in a direct insertion mode and is connected with the control part; in control, multiple paths of Vl53l0X laser ranging modules are mounted on the same I2C bus to communicate with the MCU, and each laser ranging module is provided with an independent chip selection interface which is respectively connected with different pins of the MCU; the flash of the MCU is divided into a program area and an information configuration area, and an independent information configuration address block is divided for each Vl53l0X laser ranging module in the information configuration area.

Technical Field

The invention relates to the technical field of multi-channel sensor driving, in particular to a multi-channel Vl53l0X laser ranging calibration method.

Background

The I2C bus is a simple, bi-directional two-wire synchronous serial bus developed by Philips. The bus-type data bus only needs two lines to transmit information between devices connected to the bus, is high in reliability and low in implementation cost, can mount a plurality of peripherals through a multi-address mechanism, and is a common data bus at present. The laser ranging has the advantages of small volume, high measurement precision and low power consumption, and is widely applied to medium and small distance measurement.

An ultrasonic ranging method is usually adopted in the conventional short-distance ranging scheme, the ultrasonic ranging has a large volume, the measuring time is long, the measuring dead zone is large, the measuring precision in a short distance is difficult to guarantee, the beam angle is large, the multi-sensor ranging array is difficult to realize in a narrow space, because configuration information including equipment id can be lost after the Vl53l0X is reset, only one laser ranging module is often driven or too many chip resources are occupied by a multipath bus by the scheme adopting the Vl53l0X laser ranging module, the conventional Vl53l0X driving method does not have a calibration function or only has a calibration function when power is on, and the Vl53l0X cannot be flexibly calibrated to improve the measuring precision.

The method is based on an STM32F103C8T6 chip and based on a single I2C bus to drive a plurality of paths of Vl53l0X laser ranging modules, and the method plans a flash storage space for each Vl53l0X laser ranging module to store calibration data and configuration information, so that the space is saved, and a main program is not interfered; the method executes the self-calibration program during power-on, and reduces installation errors and external environment errors without manual intervention; in the calibration process of the method, a method of calculating the variance through multiple times of calibration is adopted to ensure the accuracy of the calibration result; the method adopts a direct insertion type, can be flexibly disassembled and assembled, can recalibrate the designated module through an upper computer instruction after the module is replaced, stores designated calibration parameters in a designated flash space, and is not lost when power failure occurs.

Disclosure of Invention

The technical problem to be solved by the invention is as follows: in order to solve the problem that the conventional Vl53l0X driving method often has no calibration function or only has the calibration function when power is on and cannot flexibly calibrate the Vl53l0X so as to improve the measurement accuracy, the invention provides a multi-channel Vl53l0X laser ranging calibration method which is provided with a self-calibration program and effectively solves the problems in the prior art.

In one aspect, the present invention provides a calibration method for multi-channel Vl53l0X laser ranging,

a multi-channel Vl53l0X laser ranging calibration method and drive are characterized in that: comprises the following steps of (a) carrying out,

1) the I2C address of the Vl53l0X is lost after restarting, so that the MCU needs to configure an address for a designated module before initialization, the designated Vl53l0X laser ranging module is enabled through a specific chip selection pin, only the module can communicate with the MCU at the moment, and the address of the module is configured through an I2C bus and subsequent configuration is carried out;

2) inquiring the calibration information in a flash storage area inside the MCU corresponding to the Vl53l0X module address, and reading the compensation parameters from the corresponding flash area for configuration if the calibration information is calibrated;

3) if no calibration rule is available, starting a self-calibration program for preventing installation errors and errors caused by external environment, wherein the self-calibration program comprises the following steps:

(1) comparing the preset distance with the measured distance by a Vl53l0X module, and returning compensation parameters for correction after each measurement;

(2) repeating the calibration process for 3 times and respectively storing the measurement results;

(3) calculating the variance of the measurement results of 3 times, and if the variance is smaller than a threshold value, successfully calibrating;

(4) the MCU obtains the compensation parameters and then stores the compensation parameters in a flash area of the corresponding address of the module;

4) reading data from each Vl53l0X module in a circulating mode;

5) and the serial port outputs the measurement data.

In another aspect, the present invention provides a multi-lane Vl53l0X laser ranging calibration drive,

a multi-channel Vl53l0X laser ranging calibration drive comprises a control part and a sensor part, wherein the control part adopts an STM32F103C8T6 chip, and the sensor part adopts a plurality of Vl53l0X laser ranging modules.

Furthermore, the physical laser ranging module is fixed on the driving platform in a direct insertion mode and is connected with the control part; in control, multiple paths of Vl53l0X laser ranging modules are mounted on the same I2C bus to communicate with the MCU, and each laser ranging module is provided with an independent chip selection interface which is respectively connected with different pins of the MCU; the flash of the MCU is divided into a program area and an information configuration area, and an independent information configuration address block is divided for each Vl53l0X laser ranging module in the information configuration area.

The invention has the beneficial effects that: the method provided by the invention has the advantages that the structure is simple, the cost is low, the sensor part and the control part are connected in a modularized manner, the sensor can be replaced at will, and the method is flexible; and the multi-path sensor is mounted on the other I2C bus, so that on-chip resources can be saved, and the platform can conveniently expand other interfaces and functions. The method can achieve the driving and calibration of the Vl53l0X laser ranging module without manual intervention, and the self-calibration function can greatly reduce the system error caused by factors such as installation position and the like; and the calibration data can be stored after calibration, the power failure is not lost, and the quick response can be realized without calibrating every time of power-on. The method can monitor the measurement data in real time through the serial port, and can send a calibration command to calibrate the abnormal sensor if data abnormality is found, so that the method can be flexibly suitable for various scenes; the method of the invention saves the flash space by reasonably planning the flash storage area and can be repeatedly erased without influencing the main program.

Drawings

The invention is further illustrated with reference to the following figures and examples.

FIG. 1 is a process flow diagram of the present invention;

FIG. 2 is a calibration flow chart of the present invention;

FIG. 3 is a Flash configuration information diagram of the present invention;

Detailed Description

The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic views illustrating only the basic structure of the present invention in a schematic manner, and thus show only the constitution related to the present invention.

A multi-channel Vl53l0X laser ranging calibration method and drive includes the following steps,

1) the I2C address of the Vl53l0X is lost after restarting, so that the MCU needs to configure an address for a designated module before initialization, the designated Vl53l0X laser ranging module is enabled through a specific chip selection pin, only the module can communicate with the MCU at the moment, and the address of the module is configured through an I2C bus and subsequent configuration is carried out;

2) inquiring the calibration information in a flash storage area inside the MCU corresponding to the Vl53l0X module address, and reading the compensation parameters from the corresponding flash area for configuration if the calibration information is calibrated;

3) if no calibration rule is available, starting a self-calibration program for preventing installation errors and errors caused by external environment, wherein the self-calibration program comprises the following steps:

(1) comparing the preset distance with the measured distance by a Vl53l0X module, and returning compensation parameters for correction after each measurement;

(2) repeating the calibration process for 3 times and respectively storing the measurement results;

(3) calculating the variance of the measurement results of 3 times, and if the variance is smaller than a threshold value, successfully calibrating;

(4) the MCU obtains the compensation parameters and then stores the compensation parameters in a flash area of the corresponding address of the module;

4) reading data from each Vl53l0X module in a circulating mode;

5) and the serial port outputs the measurement data.

A multi-channel Vl53l0X laser ranging calibration drive comprises a control part and a sensor part, wherein the control part adopts an STM32F103C8T6 chip, the sensor part adopts a plurality of Vl53l0X laser ranging modules,

in a preferred embodiment, the physical laser ranging module is fixed on the driving platform in a direct insertion manner and is connected with the control part; in control, multiple paths of Vl53l0X laser ranging modules are mounted on the same I2C bus to communicate with the MCU, and each laser ranging module is provided with an independent chip selection interface which is respectively connected with different pins of the MCU; the flash of the MCU is divided into a program area and an information configuration area, and an independent information configuration address block is divided for each Vl53l0X laser ranging module in the information configuration area.

In light of the foregoing description of the preferred embodiment of the present invention, many modifications and variations will be apparent to those skilled in the art without departing from the spirit and scope of the invention. The technical scope of the present invention is not limited to the content of the specification, and must be determined according to the scope of the claims.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于透镜回波的超声探头带宽检测方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!