I’m getting hit and miss readings from MPU9255 accelerometer (ACCELEROMETER_QUERY returns incorrect readings, MEASURE_AXES_NOISE returns extremely large noise readings).
Sometimes i get good readings, sometimes xyz swapped around in a cycle, sometimes nonsense readings, using latest master as of yesterday (April 29) .
I tracked the issue down to the accelerometer’s FIFO overrun, as detected in sensor_mpu9250.c line 209
// Detect if a FIFO overrun occured
uint8_t int_reg[] = {AR_INT_STATUS};
uint8_t int_msg;
i2c_read(mp->i2c->i2c_config, sizeof(int_reg), int_reg, sizeof(int_msg),
&int_msg);
if (int_msg & FIFO_OVERFLOW_INT)
mp->limit_count++;
After testing it a bunch (~20 times), it seems that if nonzero limit_count is reported to klippy, the values are garbage. Any time a zero limit count is reported to clippy, the values seem OK.
The issue also seem to “resolve” when there is a background process using up 100% of the CPU time (such as C/C++ tools when developing remotely with visual studio). Which seems weird, if anything I would expect that background CPU load would make the problem worse.
I tried lowering rest ticks , more and more but even
rest_ticks = self.mcu.seconds_to_clock(.1 / self.data_rate)
(instead of 4. / )
did not reliably resolve the issue.
I can attach the logs but they are probably not very helpful (and also I added a bunch of my own logging to get the value of reported limit_count and to dump raw bytes).