Servers by jDrones

VL53L1X does not work proper

(smilie) #1

Hello All,

i belief - there is still the I2C Device not supported.

VL53L1X - I2C:
https://www.google.com/search?q=vl53l1x&client=firefox-b-e&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjy34mU8M_iAhXRMewKHVULAe0Q_AUIESgC&biw=1280&bih=631&dpr=1.5#imgrc=2YNzJE5m3bw4fM:

Please see for this:
http://ardupilot.org/copter/docs/common-vl53l0x-lidar.html

I compare the datasheets, and the i2c-interface is still different from VL53L0X.
So i miss an other Parameter for RNGFND_TYPE = 16 especial for VL53L1X

is there an expert to do this?

(ppoirier) #2

Hello,

Both sensors are working correctly.
Difference within models are taken care within RangeFinder main module :

(smilie) #3

You have tested this already?

I have no response from the vl53l1x.
I have this one:

with the raspberry pi and i2cdetect i see the address 0x29.

The vl53l0x works proper and i can read the values.
M1.RANGEFINDER.DISTANCE

Possible there is a problem with non-default registers?

Thanks.

(ppoirier) #4

Tested the Pololu , but the Pimoroni seems pretty standard

Have you tested this unit with a python script to make sure it works?

(ppoirier) #5

Ok I think I got it…

The actual driver is expecting this:

And the Pimoroni has this:

So you need to change line 82 from
v2 != 0xCC
to
v2 != 0xAA

If that work, I suggest you open an issue, and we will probably to add an additional parameter for VL53L1_IDENTIFICATION__MODULE_TYPE

(smilie) #6

In this Moment i have tested the VL53L1X with the pimoroni-tool.
It works nearly properly.
The graph.py give me not the expected range from 360 cm but 210 cm.
Possible i should use more voltage?

(smilie) #7

Thanks, i will report the success to you.

but, can you help me in an other case?

I have a source-setup for Cube Black.
But i use now the Pixhawk 2.4.8.
I have no idea, how to switch from the “Cube Black” and to 2.4.8.
Can you back me in this point?

I have to chose the CPU-Type - i have no idea.
I have to make a new configure like this:

configure --board fmuv2 --no-submodule-update

have you an idea how to finde the right way?

many tanks

(ppoirier) #8

@nghiajenius take a look at this :wink:

(smilie) #9

It does not work, i have no idea.

I have done this:

edit the file ardupilot/libraries/AP_RangeFinders/AP_RangeFinder_VL53L1X.cpp
./waf configure --board=fmuv2 (for my pixhawk 2.4.8)
./waf --targets bin/arduplane
./waf --targets bin/arduplane --upload

(Nghia Nguyen) #10

Hello @smilie

Please follow the guide for build source code to right target: https://github.com/ArduPilot/ardupilot/blob/master/BUILD.md

If success, then you can try modifying the source code as suggested by @ppoirier, then rebuild and check if you can read VL53L1X or not. If you can read it after modifying the check ID, please open an issue.

I’m in vacation at the moment so I will check the library again in next Monday. ST has released new library for VL53L1X, and the library I wrote was from last year, so I may need if there is new variant.

1 Like
(Nghia Nguyen) #11

Hello @smilie and @ppoirier,

I have quick checked the pimoroni/vl53l1x-python, they don’t check the module ID, value 0xAA is just copied from other libraries and not verified in code. On the other hand, I checked the latest ST datasheet, reference registers value aren’t changed.

So my guest is the ID is not really a problem here, maybe you can remove Line 81-83 in ArduPilot/ardupilot/blob/master/libraries/AP_RangeFinder/RangeFinder.cpp

if ((v1 != 0xEA) ||
(v2 != 0xCC)) {
return false;

to bypass the ID check and see if the function can actually read the register successful or not.

1 Like
(smilie) #12

Bingo - after removing the lines “81-84” the Range works fine.

Thank you very much.

(ppoirier) #13

So , ID is really an issue :laughing:

It would be interesting to probe the registers
0x010F and 0x0110 with I2C GET to get the values

(smilie) #14

I am not shure, at this point.
May be, there is only a difference between the latest Firmware from the Mission Planner (3.8) or so?

Because i change back the modification (81-84) and the range-finder works also, but if i change back to the latest Mission Planner Firmware the RangeFinder will does not work.

I’m confused to write wrong things, because my experience is week.

(ppoirier) #15

Ok
We will wait until you find the issue

(Nghia Nguyen) #16

Hello @smilie
Latest Firmware from MP are Copter-3.6 and Plane 3.9, which have not supported VL53L1X yet, I checked and saw VL53L1X driver only in master branch. So you may try the master branch or beta firmware if you want to use VL53L1X, and wait for next main release I guess. :grin:

(smilie) #17

Thanks and sory for the my excitement.