Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

VL53L0X fails PerformRefCalibration
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: VL53L0X fails PerformRefCalibration

by jerryn on Tue Dec 13, 2016 1:54 pm

Understood and not at all surprising. You folks provide an incredible amount of support via this site.
My intent was to save you some work, not add to it! Let me know if you need additional information.

jerryn
 
Posts: 1314
Joined: Sat Sep 14, 2013 9:05 am

Re: VL53L0X fails PerformRefCalibration

by jn_austin on Tue Dec 13, 2016 4:56 pm

Yes in the same boat... No use of the sensor and it's giving fixed results. Will try to play with the config steps and see if I can uncover anything...

jn_austin
 
Posts: 19
Joined: Tue Nov 22, 2011 10:43 pm

Re: VL53L0X fails PerformRefCalibration

by jerryn on Tue Dec 13, 2016 5:00 pm

With the modified code I posted or wit the Pololu Library, mine is fully functional now.

jerryn
 
Posts: 1314
Joined: Sat Sep 14, 2013 9:05 am

Re: VL53L0X fails PerformRefCalibration

by jerryn on Tue Dec 13, 2016 5:17 pm

Note that if you have run the adafruit library you need to power cycle it to get it working with either of the fixes.
To clarify, I have found that if I run the existing Adafruit library example, I get a constant reading and it will not work with any other code I load and try.
I have to power cycle the VL53L0X board after it has gotten "hung" before running any of the other working examples on it.
I have found it best to load the new version then power cycle the board before running it.
Awkward, but it works for me....
Last edited by jerryn on Tue Dec 13, 2016 5:40 pm, edited 1 time in total.

jerryn
 
Posts: 1314
Joined: Sat Sep 14, 2013 9:05 am

Re: VL53L0X fails PerformRefCalibration

by jn_austin on Tue Dec 13, 2016 5:39 pm

I'm looking at the two floating pins. Never a fan of floating anything but I did see 10K ohm pullup's to the local 2.8V supply rail. Only issue is my board's SHDN pin is LOW?

I measured it three times with the same results. I'm going to go suck the solder out of that barrel and see if things improve. Perhaps the board did not have enough clearance around the SHDN pin and excessive solder is shorting the pin to ground? Here is the board in the failing condition. I will report what i find...

Update: As expected... once the solder was removed it started to work with the default example. Still playing with it but there does appear to be insufficient clearance near the ground on the two pulled up signals. Perhaps it was just the solder mask was not applied well. In either case removing some of the solder seems to have repaired my board.
Attachments
20161213_150736.jpg
20161213_150736.jpg (188.96 KiB) Viewed 758 times

jn_austin
 
Posts: 19
Joined: Tue Nov 22, 2011 10:43 pm

Re: VL53L0X fails PerformRefCalibration

by jerryn on Tue Dec 13, 2016 6:00 pm

Just a thought. I don't know if the VL53L0X can pull XSHUT (SHDN) LOW internally. It may be that the executing code is putting it into a bad state with SHDN LOW. I suggest making sure your Arduion is not running the existing Adafruit code when you power it up and test SHDN.

Note: on mine, SHDN does read 2.8V.

jerryn
 
Posts: 1314
Joined: Sat Sep 14, 2013 9:05 am

Re: VL53L0X fails PerformRefCalibration

by jerryn on Tue Dec 13, 2016 6:01 pm

Glad it is working - What code are you running on it?

jerryn
 
Posts: 1314
Joined: Sat Sep 14, 2013 9:05 am

Re: VL53L0X fails PerformRefCalibration

by jn_austin on Tue Dec 13, 2016 6:05 pm

Data sheet says its a digital INPUT. While I believe they may have used a Bidirectional I/O in the chip (not uncommon) normally they explicitly tie off the driver portion inside the chip. I doubt it's the I/O as I really did not change the code and it started to work. I could physically measure 10K ohms from the 2.8V pin to the other floating pin. The SHDN pin was hard shorted to GND when unpowered. If it were a software type configuration i would have expected to read 10K to 2.8V as well.

BTW - it's the canned example code now running fine. Need to next see how selective (or not) the sensor is at angled surfaces. Was hoping it was more laser like and less LED like for the transmit beam!


AHHHH --- Now it's no longer working! I may have an intermittent or the code is still wonky!
Last edited by jn_austin on Tue Dec 13, 2016 6:13 pm, edited 1 time in total.

jn_austin
 
Posts: 19
Joined: Tue Nov 22, 2011 10:43 pm

Re: VL53L0X fails PerformRefCalibration

by jerryn on Tue Dec 13, 2016 6:11 pm

It sounds like it is working for you. My experience has been very different. I could only get it to work intermittently with the AdaFruit Library but it has been rock solid with the Polololu Library or with the example I run on the Raspberry Pi written in C. The changes I made to the code, I think fixed some real errors in writing multiple byte commands to the board and it seemed to fix it.
I am now using it via the Raspberry Pi and not the Arduino so I don't have a lot of run time on it.

Aha! Saw your post about it being intermittent I may not be crazy after-all!

Good luck.

jerryn
 
Posts: 1314
Joined: Sat Sep 14, 2013 9:05 am

Re: VL53L0X fails PerformRefCalibration

by jn_austin on Wed Dec 14, 2016 1:37 am

Tried a second board and this one seems to be working better.

jn_austin
 
Posts: 19
Joined: Tue Nov 22, 2011 10:43 pm

Re: VL53L0X fails PerformRefCalibration

by jerryn on Thu Dec 15, 2016 8:20 pm

Glad it seems to be working for you. I continue to think the Adafruit Library has some significant problems as currently written. The usage of memcpy is clearly flawed, in my opinion. If it is working for others, I'll go down my own path...

jerryn
 
Posts: 1314
Joined: Sat Sep 14, 2013 9:05 am

Re: VL53L0X fails PerformRefCalibration

by bprobbins on Sat Dec 17, 2016 3:22 am

@jerryn
I want to thank you for your code changes -they made it possible to get over what seemed like a big hurdle porting the library to the Particle photon. Now it seems to be working on the photon, so thanks again.

bprobbins
 
Posts: 14
Joined: Mon Mar 18, 2013 1:15 am

Re: VL53L0X fails PerformRefCalibration

by jerryn on Sat Dec 17, 2016 12:03 pm

@bprobbins,
I'm glad to hear it was useful to you! Good luck with your projects.

jerryn
 
Posts: 1314
Joined: Sat Sep 14, 2013 9:05 am

Re: VL53L0X fails PerformRefCalibration

by adafruit2 on Thu Dec 29, 2016 5:54 pm

hiya! had time today to fix the library and push the fixes, we also found a sensor that we could duplicate the error so we think its fixed-fixed

please check out
https://github.com/adafruit/Adafruit_VL53L0X
and try the latest! :)

adafruit2
Site Admin
 
Posts: 19399
Joined: Fri Mar 11, 2005 7:36 pm

Re: VL53L0X fails PerformRefCalibration

by jerryn on Fri Dec 30, 2016 1:12 pm

Thank you for incorporating the changes. I tried it on my Arduino Uno with the board that has been failing consistently and it worked fine!!

I think you overlooked (or ignored ;-) the second change I posted on Dec 10 to make a minor correction to Adafruit_VL53L0X.cpp to fix a problem compiling on the M0 and other boards. The new version still fails to compile on an M0. I think all that is needed is to remove the redundant initialization of the boolean debug input as shown in the diff below. It is already initialized to false in the .h file and some compilers object to the second initialization. The full file was posted in my Dec 10 post.

Code: Select all | TOGGLE FULL SIZE
diff -r Adafruit_VL53L0X/src/Adafruit_VL53L0X.cpp /Users/jerryneedell/Google Drive/Adafruit_software/AdaFruit_github/Adafruit_VL53L0X/src/Adafruit_VL53L0X.cpp
62c62
< VL53L0X_Error Adafruit_VL53L0X::rangingTest(VL53L0X_RangingMeasurementData_t *RangingMeasurementData, boolean debug)
---
> VL53L0X_Error Adafruit_VL53L0X::rangingTest(VL53L0X_RangingMeasurementData_t *RangingMeasurementData, boolean debug = false)


With this fix - it still works on the Arduino Uno but also compiles for the M0.

Let me know if you need more information.
Thanks and Happy New year!

jerryn
 
Posts: 1314
Joined: Sat Sep 14, 2013 9:05 am

Please be positive and constructive with your questions and comments.