ToF VL53L1 sensor issues

Firmware/software/electronics/mechanics
Post Reply
agren
Beginner
Posts: 2
Joined: Fri Apr 03, 2020 9:39 am

ToF VL53L1 sensor issues

Post by agren »

Hi everyone,
My friend and I are currently working on our master thesis and using the CF2.1 with a FPV camera to land autonomously. One of the goals of the project is to attempt to account for the ground effect. In order to do this, we need accurate and precise height readings. However, we have noticed that the ToF sensor (VL53L1) of the Flowdeck v2 is inconsistent in that the height reading (range.zrange) has different behavior and offset depending on the piece (we have two cf+flowdeck setups), i.e. two drones have different readings with the same flowdeck.

According to the data sheet three different kinds of calibration can be done. Described briefly here: https://www.google.com/url?sa=t&rct=j&q ... tN4H_-E8oN and described more thoroughly here in chapter 3: https://www.st.com/resource/en/user_man ... ronics.pdf.

Example of "weird" sensor readings from one of the flowdecks:
The following graph was extracted from the client when lowering the cf slowly by hand from 10cm to 0cm. As you can see, the readings are good until a few cm off the ground where they seem to clip to zero. Then, when the drone is 0cm off the ground (i.e. stationary on ground), the readings are ~1.5 cm.
Screenshot from 2020-04-03 10-10-27.png

To account for this, we have tried:
1. Changing the distance mode to SHORT. In https://github.com/bitcraze/crazyflie-f ... er2.c#L123:

Code: Select all

VL53L1_SetDistanceMode(&dev, VL53L1_DISTANCEMODE_MEDIUM);
to

Code: Select all

VL53L1_SetDistanceMode(&dev, VL53L1_DISTANCEMODE_SHORT);
This had no effect.

2. Adding the following code on this line: https://github.com/bitcraze/crazyflie-f ... er2.c#L125, i.e. some kind of manual offset calibration.

Code: Select all

VL53L1_GetCalibrationData(&dev, &calData);
calData.customer.mm_config__inner_offset_mm = -15;
calData.customer.mm_config__outer_offset_mm = -15;
VL53L1_SetCalibrationData(&dev, &calData);
This compensated for the offset, but for the nonlinear "clipping" phenomenon.


We are wondering what kind of calibration has been done (by manufacturer/Bitcraze in/after production)/is done (e.g. at system startup) with the sensor?
Or, is this the result of filtering somewhere in the crazyflie firmware?

Thanks in advance,
Simon

EDIT: Just realized this probably was posted in the wrong category. Could a mod please move the post? (
Crazyflie NanoQuadcopter \ Developer Discussions ?)
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: ToF VL53L1 sensor issues

Post by kimberly »

Hi, I just moved the topic.

We don't (re)calibrate the sensor when the flowdeck/zranger decks are assembled. We assemble the sensors as is and only test the connection with the sensor.

So the datasheet of the VL53L1x does say that any measurement under 4 cm is unreliable: https://www.st.com/resource/en/datasheet/vl53l1x.pdf (page 16. 3.3 Minimum ranging distance). So that you are seeing this at 1.5 cm might be due to that.

We are not exactly sure why it is unreliable though below the 4 cm limit.
agren
Beginner
Posts: 2
Joined: Fri Apr 03, 2020 9:39 am

Re: ToF VL53L1 sensor issues

Post by agren »

Hi and thanks for the reply kimberly,

In our ctrl+f of the documentation we apparently missed the minimum ranging distance... :roll: Thanks for pointing that out!

I'll write here if we decide to try to calibrate the sensor and how that turns out.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: ToF VL53L1 sensor issues

Post by kimberly »

No worries! You guys shared the usermanual which didn't say anything about this limit, but the datasheet I shared did. Let us know if you find anything else!
wydmynd
Member
Posts: 87
Joined: Thu Dec 06, 2018 9:25 am

Re: ToF VL53L1 sensor issues

Post by wydmynd »

btw the zranger1 should have better performance under 4cm
Post Reply