cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L4CX - Temperature Issues (Drift)

LeandroIstan
Associate II

Recently, I started a post about drift in the static level measurement using the VL53L4CX. I received some directions to continue the investigation, which I followed. I tested the performance by toggling the XSHUT pin as suggested, but it didn’t work. So, I proceeded with testing the drift using the ESP's temperature readings and found some interesting results.

Using a fully black plastic bucket with around 10 mm of water, I observed that the drift occurred at two specific times: 8 AM and 6 PM. These times coincide with when the air conditioner turns on and off at the company where I work.

The drift is perfectly parallel to the ESP’s temperature variation.

I believe the sensor isn’t operating within the correct range during these temperature fluctuations, or it’s not applying the proper correction for them.

I’d like to ask: Is there any way to make the correction more accurate, or even fully disable the temperature correction so I can calibrate it locally?

I'm creating this new post because I accidentally marked the first answer as the solution incorrectly.

Original post:

https://community.st.com/t5/imaging-sensors/vl53l4cx-drift-on-static-level/m-p/779779#M5202

 

1 REPLY 1
John E KVAM
ST Employee

The sensor adjusts to temperature changes - but perhaps not as well as you would like. I believe an adjustment is made for every two degrees C. Your temperature might not have moved that far, so you see drift and no correction.

But we can try your idea. 

In the VL53L4CD (notice it's not the CX driver) there are a few lines of code in the init function that seem odd. 

The registers are written to the device, it does one range, waits for completion, and then sets:

	status |= VL53L4CD_WrByte(dev,
			VL53L4CD_VHV_CONFIG__TIMEOUT_MACROP_LOOP_BOUND, 
                        (uint8_t)0x09);

This line limits the amount of time we allow the VHV to establish a new setting. It's enough time to adjust up or down a couple of degrees C.

If you change that 9 to 1, I believe that you will disable the VHV from changing. (NOTE: edited. 1 is the lowest it can go and still operate.)

Then you can apply your own temperature correction. 

Will this work? I have no idea. You are on your own here. 

This Idea might work, but I'd suspect that if the temperature changed too much the sensor would not work very well.

So keep a close eye on the temperature and if it changes too much, stop the sensor, reset that register to its default of 0x81, range once, then you can set it back to 0.

your first test should be to determine if this register works the way I think it does. 

Set the register to 0, then slowly heat your system. If the range slowly drifts then we have turned off the VHV. If it drifts and then corrects and you get a saw tooth shape, then the VHV is NOT disabled. 

Next, test the limits of your non-VHV system. Slowly heat and cool it to test the limits. It might be that the system simply quits working after too much temperature drift. 

This is going to take a lot of verification. ST does not support this mode of operation. We simply have no data. And no idea of how well it will work.

Please let me know how it turns out. 


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.