2024-01-29 03:56 PM
I am using the VL6180 (not the X version). This is TOF only. When reading in continuous mode, I'm getting a tolerance of +/- 1mm and sometimes more. I'll list my settings below. My application will measure distances from 10mm to 100mm. Right now I have the inter-measurement period set to 500ms and this is flexible. How can I optimize my settings further for accuracy? thanks
VL6180_WriteByte(0x0207, 0x01);
VL6180_WriteByte(0x0208, 0x01);
VL6180_WriteByte(0x0096, 0x00);
VL6180_WriteByte(0x0097, 0xfd);
VL6180_WriteByte(0x00e3, 0x00);
VL6180_WriteByte(0x00e4, 0x04);
VL6180_WriteByte(0x00e5, 0x02);
VL6180_WriteByte(0x00e6, 0x01);
VL6180_WriteByte(0x00e7, 0x03);
VL6180_WriteByte(0x00f5, 0x02);
VL6180_WriteByte(0x00d9, 0x05);
VL6180_WriteByte(0x00db, 0xce);
VL6180_WriteByte(0x00dc, 0x03);
VL6180_WriteByte(0x00dd, 0xf8);
VL6180_WriteByte(0x009f, 0x00);
VL6180_WriteByte(0x00a3, 0x3c);
VL6180_WriteByte(0x00b7, 0x00);
VL6180_WriteByte(0x00bb, 0x3c);
VL6180_WriteByte(0x00b2, 0x09);
VL6180_WriteByte(0x00ca, 0x09);
VL6180_WriteByte(0x0198, 0x01);
VL6180_WriteByte(0x01b0, 0x17);
VL6180_WriteByte(0x01ad, 0x00);
VL6180_WriteByte(0x00ff, 0x05);
VL6180_WriteByte(0x0100, 0x05);
VL6180_WriteByte(0x0199, 0x05);
VL6180_WriteByte(0x01a6, 0x1b);
VL6180_WriteByte(0x01ac, 0x3e);
VL6180_WriteByte(0x01a7, 0x1f);
VL6180_WriteByte(0x0030, 0x00);
// Recommended : Public registers - See data sheet for more detail
VL6180_WriteByte( 0x0011, 0x30); // Active high. Interrupt enabled
VL6180_WriteByte( 0x010a, 0x30); // Set the averaging sample period (compromise between lower noise and increased execution time)
VL6180_WriteByte( 0x003f, 0x46); // Sets the light and dark gain (upper nibble). Dark gain should not be changed.
VL6180_WriteByte( 0x0031, 0xFF); // sets the # of range measurements after which auto calibration of system is performed
VL6180_WriteByte( 0x002e, 0x01); // perform a single temperature calibration of the ranging sensor
// Optional: Public registers - See data sheet for more detail
VL6180_WriteByte( 0x001b, 0x31); // Set default ranging inter-measurement period to 500ms (changing from 100ms or 0x09 to 500ms 0x31)
VL6180_WriteByte( 0x0014, 0x04); // Configures interrupt on New sample ready
VL6180_WriteByte(SYSRANGE_MAX_CONVERGENCE_TIME, 0x3F); // 0x14 = 20ms
VL6180_WriteByte(SYSRANGE__START, 0x03); // Bit 1 = 0 (single shot). Bit 1 = 1 (continuous mode).
Solved! Go to Solution.
2024-01-29 06:49 PM
Hi
From your shred range result performance, I think +/-1mm is already the best case with 6180 sensor, if you want more accuracy, what I can suggest is applying a post-process rolling average if possible. rolling average will give you a better accuracy but will lead time legacy, you can try with still or low speed target, not suggested for fast moving target.
Br
Zhiyuan.Han
2024-01-29 06:49 PM
Hi
From your shred range result performance, I think +/-1mm is already the best case with 6180 sensor, if you want more accuracy, what I can suggest is applying a post-process rolling average if possible. rolling average will give you a better accuracy but will lead time legacy, you can try with still or low speed target, not suggested for fast moving target.
Br
Zhiyuan.Han